js_ifelse | R Documentation |
Convert an R logical expression into a JS ternary expression
js_ifelse(condition, if_true = "", if_false = "")
condition |
An R logical expression (supports %in% / %notin% / grepl() / comparisons / & |) |
if_true |
String to return when the condition is TRUE. Default is an empty string, which interprets as |
if_false |
String to return when the condition is FALSE. Default is an empty string, which interprets as |
A single character string containing a JavaScript ternary expression.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.