Skip to content

brandonyph/R-Shiny-Tutorial

Repository files navigation

Basic UI Example

ui <- fluidPage(theme = shinytheme("cerulean"),
                navbarPage(
                  "Shinny Page",
                  
                    tabPanel("Main Tab",
                              sidebarPanel("This is the side"),
                              mainPanel("This is the Main")
                              ),
                    
                    
                    tabPanel("Tab2","In Progress")
                  )
      )
server <- function(input, output) {
  
  output$distPlot <- renderPlot({
    
    
    if(input$SelectPlot =="Jitter"){
      a <- ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width)) + geom_jitter(shape=input$Shape)
    }
    
     if(input$SelectPlot =="Scatter"){
      a <- ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width)) + geom_point(shape=input$Shape)
     }
    
     if(input$SelectPlot =="Line"){
      a <- ggplot(iris,aes(x=Sepal.Length,y=Sepal.Width)) + geom_line(col=input$Shape)
     }
  
    
    a
  })#output$dist
}#Server
shinyApp(ui = ui, server = server)
## PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

Shiny applications not supported in static R Markdown documents

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published