Output Function for Displaying reactive objects and values
Arguments
- id
Character string. A unique identifier for the output element.
- type
Character string. Specifies the type of output. Can be "question", "value", or
NULL.
IfNULL
, the function behaves likeshiny::uiOutput()
.- display
Character string. Specifies the display type for "value" outputs. Can be "inline", "text", "verbatim", or "ui". Only used when
type = "value"
.- wrapper
Function. A function to wrap the output. Only used when
type = "value"
.- ...
Additional arguments passed to the underlying Shiny functions or the wrapper function.
Details
The function behaves differently based on the type
parameter:
If
type
isNULL
, it acts likeshiny::uiOutput()
.If
type
is"question"
, it creates a placeholder for a reactive survey question.If
type
is"value"
, it creates an output to display the value of a survey question, with the display style determined by thedisplay
parameter.
Examples
if (FALSE) { # \dontrun{
# Create a placeholder for a reactive question
sd_output('cbc1', type = 'question')
# Display the value of a survey question inline
sd_output('cbc1', type = 'value', display = 'inline')
# Use as a simple uiOutput
sd_output('redirect')
# Use with a wrapper function
sd_output('age', type = 'value', display = 'text',
wrapper = function(x) tags$strong(x))
} # }