Storge changes
This commit is contained in:
50
project/App-Kredit/app.r
Normal file
50
project/App-Kredit/app.r
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
|
||||
|
||||
################
|
||||
# Im folgenden Abschnitt wird das User Interface (UI) definiert
|
||||
ui <- fluidPage(
|
||||
|
||||
# Titel der App
|
||||
titlePanel("Kredit"),
|
||||
|
||||
# Layout für die Eingaben in die App und die Ausgaben
|
||||
sidebarLayout(
|
||||
|
||||
# Die Definition der Eingabefelder auf der linken Seite
|
||||
sidebarPanel(
|
||||
sliderInput("obs",
|
||||
"Number of observations:",
|
||||
min = 1,
|
||||
max = 1000,
|
||||
value = 500),
|
||||
selectInput("select", h3("status"),
|
||||
choices = list("no checking account" = 1, "... < 0 DM" = 2,
|
||||
"0<= ... < 200 DM" = 3, "... >= 200 DM / salary for at least 1 year" = 4 ), selected = 1),
|
||||
selectInput("select", h3("credit_history"),
|
||||
choices = list("delay in paying off in the past" = 0, "critical account/other credits elsewhere" = 1,
|
||||
"no credits taken/all credits paid back duly" = 2, "existing credits paid back duly till now" = 3,
|
||||
"all credits at this bank paid back duly" = 4), selected = 0),
|
||||
selectInput("select", h3("purpose"),
|
||||
choices = list("others" = 0, "car (new)" = 1, "car (used)" = 2, "furniture/equipment" = 3, "radio/television" = 4,
|
||||
"domestic appliances" = 5, "repairs" = 6, "education" = 7, "vacation" = 8, "retraining" = 9,
|
||||
"business" = 10), selected = 0),
|
||||
),
|
||||
# der Hauptbereich der Nutzeroberfläche für die Ausgabe der Ergebnisse
|
||||
mainPanel(
|
||||
plotOutput("distPlot")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
############
|
||||
|
||||
|
||||
server <- function(input, output) {
|
||||
output$distPlot <- renderPlot({
|
||||
# generate an rnorm distribution and plot it
|
||||
dist <- rnorm(input$obs)
|
||||
hist(dist)
|
||||
})
|
||||
}
|
||||
shinyApp(ui = ui, server = server)
|
||||
@@ -3,7 +3,7 @@ dat <- read.table("SouthGermanCredit.asc", header=TRUE)
|
||||
|
||||
## dat contains numbers for all variables.
|
||||
|
||||
## variables duration, amount and age are truly quantitative
|
||||
## variables durtion, amount and age are truly quantitative
|
||||
## variables installment_rate, present_residence and number_credits are
|
||||
### quantitative in the data, but are in fact discretized scores for
|
||||
### an underlying quantitative variable
|
||||
|
||||
4
project/run-Kredit.r
Normal file
4
project/run-Kredit.r
Normal file
@@ -0,0 +1,4 @@
|
||||
setwd("/config/workspace/assistenz-r/project")
|
||||
library(shiny)
|
||||
|
||||
runApp("App-Kredit",port = 12345)
|
||||
Reference in New Issue
Block a user