output_text | R Documentation |
Adds a textual output based on the current state of input elements.
output_text(text, tag = "p", id = NULL, class = NULL, condition = NULL)
text |
A vector of text to be parsed; see details. |
tag |
Tag name of the element containing the text. |
id |
Unique ID of the output element. |
class |
Class names to add to the output's element. |
condition |
A conditional statement to decide visibility of the entire output element. |
text
can include references to inputs by ID within curly brackets
(e.g., "{input_id}").
Multiple entries in text
translate to separate elements. Each entry can be
conditioned on a statement within curly brackets following an initial question mark
(e.g., "?{input_a != 1}Input A is not 1"
). If no statement is included after the question mark,
the entry will be conditioned on a referred to input (TRUE
if anything is selected).
Embedded reset buttons can be specified within square brackets (e.g., "Reset[r input_id]"
).
Text before the brackets will be the button's display text, with multiple words included within parentheses
(e.g., "(Reset Input A)[r input_a]"
). If the text is a reference, this will be the default reset
reference (e.g., "{input_a}[r]"
is the same as "{input_a}[r input_a]"
).
A character vector of the containing element of the text.
# text that shows the current value of `input_a`, and resets it on click
output_text("Selection: {input_a}[r]")
# adds a parenthetical if the value of the input is 0
output_text(c("Selection: {input_a}[r]", "?{input_a == 0}(input is zero)"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.