Pipe-Friendly Vector Replacement with Case Statements
OTHER License
Bot releases are visible (Hide)
default
or .default
(#5).default
into account when determining the class of output (#5).NA
s and FALSE
s with no TRUE
s.plu
functions (#4).Published by rossellhayes over 3 years ago
*_case()
would return NULL
if no conditions were TRUE
.tibble
to suggested packages.Published by rossellhayes over 3 years ago
Added *_case_fct()
family of functions
*_case()
equivalents, but return factorsin_case_fct(x < 10 ~ "Low", x < 20 ~ "Medium", default = "High")
returns a factor with levels "Low"
, "Medium"
, and "High"
.Added *_case_list()
family
*_case()
equivalents, but return listsImplemented lazy-ish evaluation of outputs.
condition
in if_case()
never takes one of the three logical values,if_case()
no longer produces an error if condition
is only NA
.Published by rossellhayes almost 4 years ago
stats
.Published by rossellhayes almost 4 years ago
grep_case()
which works similarly to switch_case()
but uses pattern matching instead of exact matching.fn_case()
which applies a function to the input and each formula's left-hand side to create the logical vectors used by in_case()
.fn_switch_case()
which applies a function to the left-hand side of each formula to create the vectors used by switch_case()
.Published by rossellhayes about 4 years ago