Created
August 19, 2018 22:41
-
-
Save chan-ume/d6b70b2b28e1f2227c385edc3e51f1df to your computer and use it in GitHub Desktop.
shiny-exapmle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyServer(function(input, output) { | |
output$distPlot <- renderPlot({ | |
x <- iris[, input$numericInputData] | |
bins <- seq(min(x), max(x), length.out = input$sliderInputData + 1) | |
hist(x, breaks = bins, col = 'darkgray', border = 'white') | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(fluidPage( | |
titlePanel("numericInput"), | |
sidebarLayout( | |
sidebarPanel( | |
numericInput("numericInputData", | |
"irisデータでヒストグラムを表示する列番号", | |
min = 1, | |
max = 4, | |
value = 1), | |
sliderInput("sliderInputData", | |
"Number of bins:", | |
min = 1, | |
max = 50, | |
value = 30) | |
), | |
mainPanel( | |
plotOutput("distPlot") | |
) | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment