Package: incase 0.3.2.9000

incase: Pipe-Friendly Vector Replacement with Case Statements

Offers a pipe-friendly alternative to the 'dplyr' functions case_when() and if_else(), as well as a number of user-friendly simplifications for common use cases. These functions accept a vector as an optional first argument, allowing conditional statements to be built using the 'magrittr' dot operator. The functions also coerce all outputs to the same type, meaning you no longer have to worry about using specific typed variants of NA or explicitly declaring integer outputs, and evaluate outputs somewhat lazily, so you don't waste time on long operations that won't be used.

Authors:Alexander Rossell Hayes [aut, cre, cph], Patrice Kiener [ctb]

incase_0.3.2.9000.tar.gz
incase_0.3.2.9000.zip(r-4.5)incase_0.3.2.9000.zip(r-4.4)incase_0.3.2.9000.zip(r-4.3)
incase_0.3.2.9000.tgz(r-4.4-any)incase_0.3.2.9000.tgz(r-4.3-any)
incase_0.3.2.9000.tar.gz(r-4.5-noble)incase_0.3.2.9000.tar.gz(r-4.4-noble)
incase_0.3.2.9000.tgz(r-4.4-emscripten)incase_0.3.2.9000.tgz(r-4.3-emscripten)
incase.pdf |incase.html
incase/json (API)
NEWS

# Install 'incase' in R:
install.packages('incase', repos = c('https://rossellhayes.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/rossellhayes/incase/issues

On CRAN:

magrittrmagrittr-pipesrecode-valuestidyverse

3.85 score 7 stars 9 scripts 259 downloads 17 exports 7 dependencies

Last updated 4 months agofrom:3cbec4219c. Checks:OK: 5 NOTE: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 07 2024
R-4.5-winNOTENov 07 2024
R-4.5-linuxNOTENov 07 2024
R-4.4-winOKNov 07 2024
R-4.4-macOKNov 07 2024
R-4.3-winOKNov 07 2024
R-4.3-macOKNov 07 2024

Exports:%>%fn_casefn_case_fctfn_case_listfn_switch_casefn_switch_case_fctfn_switch_case_listgrep_casegrep_case_fctgrep_case_listif_casein_casein_case_fctin_case_listswitch_caseswitch_case_fctswitch_case_list

Dependencies:backportscligluelifecyclemagrittrplurlang

Readme and manuals

Help Manual

Help pageTopics
Case statements applying a function to all inputsfn_case
Switch-style recoding of values with string pattern matchinggrep_case
Pipe-friendly vectorized ifif_case
A pipe-friendly general vectorized ifin_case
Case statements returning a factorfn_case_fct fn_switch_case_fct grep_case_fct in_case_fct switch_case_fct
Case statements returning a listfn_case_list fn_switch_case_list grep_case_list in_case_list switch_case_list
Switch-style recoding of valuesfn_switch_case switch_case