pgroup: Pivot table inspired grouping.

Description Usage Arguments Details

Description

Pivot table inspired grouping.

Usage

1
pgroup(col, strgroup, suffix = ".grp", new = FALSE)

Arguments

col

Vector; use in data.table.

strgroup

Grouping string in the format of "Other+Unknown=Other". Supports fuzzy match. "O+U=Other", if Other and Unknown are the only categories starting with O and U. Supports "NA+U=Other". For blanks, use "$+O=Other".

suffix

Suffix of created grouped column.

new

Create a new column of the grouped categories. Default to FALSE.

Details

No debugging / error catching.


xh2/smtools documentation built on Nov. 5, 2019, 12:24 p.m.