fct_prefix: Prefix something whilst preserving original sort order

fct_prefixR Documentation

Prefix something whilst preserving original sort order

Description

Prefix something whilst preserving original sort order

Usage

fct_prefix(x, prefix)

Arguments

x

numeric, string, etc.

prefix

string

Value

a factor that sorts in the same order as x

Note

FIXME: move to more appropriate home (package)

Examples

x <- c(33, 156, 44)
prefixed <- fct_prefix(x, prefix = "#")
sort(prefixed)
sort(str_c("#", x)) # not the same


BAAQMD/strtools documentation built on May 3, 2024, 10:56 a.m.