Let's start with so motivational material. I recommend you to visit website: https://shiny.rstudio.com/gallery/
Impressive, isn't ? I was watching with open mouth all this visualizations, changing parameters and observing how it would change. Creating such reports are possible with R shiny app. Shiny is an open source R package for building web application. First install it on your computer.
install.packages("shiny")
R Shiny Framework
Choose in your open RStudio: File-> New Project->New Directory->Shiny web Application. RStudio will create script app.R
Delate the content and write shinyapp and press Shift+Tab, you should see the following:
ui <- fluidPage(
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
This is the main structure when you are building your shiny app. You need user interface (ui), server and shinyApp() function.
There are three pieces of an interactive component:
1. User interface will collect user input
2. Server function gives recipe for output
3. User interface displays output
To give the particular look to your app you can use some already existing layout. For example the most popular sidebar layout or grid layout.
In the next post I will describe step by step how I build my first R shiny app.
Comments
Post a Comment