Count Delimited Columns
count_delim.Rd
Counts columns when values within them are delimited.
Usage
count_delim(
data,
...,
delim = "|",
sort = FALSE,
name = NULL,
trim = TRUE,
convert = FALSE
)
Arguments
- data
A data.frame.
- ...
<
data-masking
> Variables to group by.- delim
A delimiter to split elements within specified columns by (default: "|").
- sort
If
TRUE
, will show the largest groups at the top.- name
The name of the new column in the output.
If omitted, it will default to
n
. If there's already a column calledn
, it will usenn
. If there's a column calledn
andnn
, it'll usennn
, and so on, addingn
s until it gets a new name.- trim
Whether to trim start/end whitespace, as a boolean (default:
TRUE
).- convert
Whether to run
utils::type.convert()
withas.is = TRUE
on new columns. This is useful if the de-concatenated columns are integer, numeric or logical. NOTE: "NA" strings will always be converted toNA
s.