Dear All,
In my code below, i have created tabs using tabset panel. I want to hide tab 3 and 4(not delete),
and when required I want to show them. Is there a way we can execute this. Please assist.
'''
UI
library(shiny)
library(shinydashboard)
shinyUI(fluidPage(
titlePanel("Test of Skills"),
sidebarLayout(
sidebarPanel(("Details Enter Page"),
selectInput("data", "Select the dataset which has to be selected for analysis",
choices = c("iris" , "pressure" , "USArrests")),
radioButtons("color", "Select the color of the histogram",
choices = c("green", "orange","red","pink")),
sliderInput("bins", "select the number of bins required for histogram",
min = 5 , max = 25 , value = 5 , step = 1),
numericInput("obs" , "Select the number of observation required for dataset" ,
min = 5, max = 100 , value = 5 , step = 1),
submitButton("Confirm")),
mainPanel((" Analysis Of the Dataset"),
tabsetPanel(type = c("pills"),
tabPanel("Summary", h1(textOutput("MysumHeader")) ,
verbatimTextOutput("Mysum")),
tabPanel("Structure and Observation" , h1(textOutput("Mystrobsheader")),
verbatimTextOutput("Mystr") , h1(textOutput("Myobsheader")), verbatimTextOutput("Myobs")),
tabPanel("Data Selected" , tableOutput("Mydata")),
tabPanel("Histogram Plot"))
))))
Server
library(shiny)
library(shinydashboard)
library(datasets)
shinyServer(function(input,output){
output$Mysum <- renderPrint({
summary(get(input$data))
})
output$MysumHeader <- renderText({
paste("The Dataset which is selected for analysis" , input$data)
})
output$Mystr <- renderPrint({
str(get(input$data))
})
output$Mystrobsheader <- renderText({
paste("DataSet selected for structure is " , input$data)
})
output$Myobs <- renderPrint({
head(get((input$data)))
})
output$Myobsheader <- renderText({
paste("First" , input$obs , "Selected from the datase" , input$data)
})
output$Mydata <- renderTable({
View(get(input$data))
})
})
'''