M. Chellakumar
05-03-2019
This is UI.R page
library(shiny)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
titlePanel("Drawing Histogram for a selected count of random numbers"),
# Sidebar with a slider input for choosing count of numbers
sidebarLayout(
sidebarPanel(
sliderInput("num",
"Choose a Number:",
min = 1,
max = 50,
value = 25
)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("hist")
)
)
))
<!–html_preserve–>
This is the Server.R page
library(shiny)
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
output$hist <- renderPlot({
hist(rnorm(input$num),col = 'darkgray', border = 'white')
})
})