R Code

this is an web-app that could plot a histogram with user-given title ,random number scale,color,breakpoints

#'@param title  : title of histogram
#'@param obs    : scale of  random number subject to uniformal distribution
#'@param breaks : number of breakpoints for the histogram
#'@param col    : the color to fill each cell in the histogram

code for ui.R

shinyUI(pageWithSidebar(
                
                headerPanel("plot a histogram"),
                
                sidebarPanel(
                        textInput("title",
                                  "title of your plot",
                                  value=""),
                        
                        sliderInput("obs",
                                    "how many numbers",
                                    min=0,
                                    value=100,
                                    max=200
                                    ),
                        
                        sliderInput("breaks",
                                    "input number of breakpoints",
                                    min=1,
                                    max=20,
                                    value=5
                                    ),
                        
                        textInput("col",
                                  "which col would like to use in your histogram",
                                  value=""
                                )
                ),
                
                mainPanel(
                        
                        plotOutput("histo")
                )
        )
        
)

code for server.R

shinyServer(
                function(input,output){
                        output$histo = renderPlot(
                                                {
                                                      rand = rnorm(input$obs);
                                                      hist(rand, 
                                                           breaks = input$breaks,
                                                           col    = input$col,
                                                           main   = input$title,
                                                           border = "white"
                                                           );
                                                }
                                             )
                        
                                
                }
        )