Skip to content

Instantly share code, notes, and snippets.

@vnijs
Forked from jcheng5/server.R
Last active August 29, 2015 14:23
Show Gist options
  • Save vnijs/7a8e9fe7112a0144c1ac to your computer and use it in GitHub Desktop.
Save vnijs/7a8e9fe7112a0144c1ac to your computer and use it in GitHub Desktop.
shinyServer(function(input, output, session) {
# On startup, read the URL parameter
queryParams <- parseQueryString(isolate(session$clientData$url_search))
if ('tab' %in% names(queryParams))
updateTabsetPanel(session, 'tabset', selected = paste0('tab', queryParams[['tab']]))
})
shinyUI(fluidPage(
tabsetPanel(id = "tabset",
tabPanel(value = "tab1", "One"),
tabPanel(value = "tab2", "Two"),
tabPanel(value = "tab3", "Three")
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment