posayahoo.blogg.se

Rstudio r shiny
Rstudio r shiny





rstudio r shiny

In order to access the input that we gave in the ui section of the app, we need to use input$ with what the input is named, in this case bins.

  • renderText() creates a character string.
  • renderDataTable() creates an interactive table.
  • renderPlot() only creates a plot, while there are a variety of other functions for other types of outputs.
  • You will build the objects to display using render*() functions.
  • In this case, you would write output$distPlot because you saved the output as “distPlot” in the previous function.
  • You save your objects to display using “output$”.
  • When writing the server function, you need to follow 3 rules:

    rstudio r shiny

    The second section function(input, output) actually builds the output. The Output function adds space in the UI for an R object which we’ll build in the server function. The term plot determines the type of output that will be displayed (other types of outputs include tableOutput, imageOutput, and textOutput) and “distPlot” is the name given to the output object (you can name this whatever you want). To display the output, the function looks like plotOutput(“distPlot”). The format is a question mark, and then the input type which you are unsure about. If you’re unsure about how any of the functions work, you can type ?sliderInput for any additional information. The next item Number of bins: is the label that is displayed. The first item under sliderInput( ) is bins which is the name of the input. You can change the title, what type of input you want (numericInput( ), selectInput( ), and dateInput( ) are popular as well), and the elements within the input (like the minimum, maximum and preset values). The fluidPage contains both the input and output functions, for example, the titlePanel, sliderInput, and plotOutput. The first section fluidPage() contains the elements in the app.

  • 8 Interactive Applications Using RShiny.






  • Rstudio r shiny