dplyr::if_else with the virtues and vices that come from such an approach.
Attempts to replicate
dplyr::if_else but written in base R for faster compile time.
hutils::if_else should be faster than
dplyr::if_else ... when it works,
but will not work on lists or on factors.
Additional attributes may be dropped.
if_else(condition, true, false, missing = NULL)
Where condition is
If condition is
If the result is expected to be a factor then the conditions for type safety are strict and may be made stricter in future.
TRUE, the corresponding value in
FALSE, the corresponding value in
NA, then the corresponding value in
NULL (the default) in which case the value will be
NA (with the same
Original code but obviously heavily inspired by https://CRAN.R-project.org/package=dplyr.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.