fct_case_when: Ordered Factor case_when()

Description Usage Arguments Value

Description

\lifecycle

experimental Can replace 'case_when()' syntax and outputs an ordered factor in the same order as the cases, useful for meaningful ordering in plots and tables. This is because for 'case_when()' the arguments are evaluated in order, so you must proceed from the most specific to the most general. Tables and plots will therefor be ordered by the evaluation order.

Usage

1

Arguments

...

A sequence of two-sided formulas. See ?dplyr::case_when for details

Value

An ordered factor vector of length 1 or n, matching the length of the logical input or output vectors, with the type (and attributes) of the first RHS. Inconsistent lengths or types will generate an error.


Sorenson-Impact/sorensonimpact documentation built on Nov. 6, 2021, 4:25 a.m.