Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (55 sloc) 1.912 kb
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/bootstrap.R
\title{Conditional Panel}
conditionalPanel(condition, ...)
\item{condition}{A JavaScript expression that will be evaluated repeatedly to
determine whether the panel should be displayed.}
\item{...}{Elements to include in the panel.}
Creates a panel that is visible or not, depending on the value of a
JavaScript expression. The JS expression is evaluated once at startup and
whenever Shiny detects a relevant change in input/output.
In the JS expression, you can refer to \code{input} and \code{output}
JavaScript objects that contain the current values of input and output. For
example, if you have an input with an id of \code{foo}, then you can use
\code{} to read its value. (Be sure not to modify the input/output
objects, as this may cause unpredictable behavior.)
You are not recommended to use special JavaScript characters such as a
period \code{.} in the input id's, but if you do use them anyway, for
example, \code{inputId = ""}, you will have to use
\code{input[""]} instead of \code{} to read the input
"plotType", "Plot Type",
c(Scatter = "scatter",
Histogram = "hist")),
# Only show this panel if the plot type is a histogram
condition = "input.plotType == 'hist'",
"breaks", "Breaks",
"[Custom]" = "custom")),
# Only show this panel if Custom is selected
condition = "input.breaks == 'custom'",
sliderInput("breakCount", "Break Count", min=1, max=1000, value=10)
Jump to Line
Something went wrong with that request. Please try again.