Description Usage Arguments Examples
View source: R/fragment_conditional.R
Return a single character value from a pre-defined set based on a corresponding set of conditions
1 | CreateConditionalFragment(items, conditions, fallback = NA)
|
items |
An unnamed list of character values in the desired order. |
conditions |
A list of boolean values corresponding to each value in items. When more than one value is true, the first is returned. |
fallback |
The character string to return when the list is empty or no conditions are met. |
1 2 3 4 | x <- 10
example_items <- list("an increase", "a decrease", "no change")
example_bool <- list(x > 0, x < 0, x == 0)
CreateConditionalFragment(example_items, example_bool)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.