View source: R/TruthyHelpers.R
PickTruthy | R Documentation |
Choose a value if it truthy. If not, choose it's replacement
PickTruthy(X, Replacement)
X |
A value of any type |
Replacement |
The replacement in case |
X
or Replacement
PickTruthy(1, 2) # 1 PickTruthy("1", 2) # "1" PickTruthy("", 2) # 2 PickTruthy(NULL, 3) # 3 PickTruthy(NULL, NA) # NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.