assistenz-r/project/App-Kredit/app.r
2021-12-30 08:32:44 +01:00

50 lines
1.8 KiB
R

################
# 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)