Skip to content

Introduce "case" function for base R

Weymeirsch, Jan requested to merge casethen into main

In combination with efforts in https://gitlab.rlp.net/mikrosim/mikrosim-modules/-/merge_requests/288.

Example:

dat <- runif(100)

casethen(
    case = list(dat > 0.3, dat > 0.6, dat > 0.9),
    then = c("A", "B", "C"),
    otherwhise = dat
)

Merge request reports