mergeCats | R Documentation |
Functions for merging and renaming categories in character or factor columns.
mergeCats(x, ..., asFactor = F, levels = NULL)
renameCats(x, ..., asFactor = F, levels = NULL)
x |
A column or vector whose categories are to be merged or renamed. |
... |
The name of each argument is a new category, and the value of each argument is a vector of names of old categories (as character values, even if the original column/vector contains factors). |
asFactor |
Do you want the result to be a factor? |
levels |
If asFactor = T, you an use this to set the levels of the factor. |
A column or vector with the desired changes.
sbc007 = changeField(sbc007, entity = "token", layer = "",
fieldName = "kind",
expression = mergeCats(kind, Vocalism = c("Laugh", "Vocalism")))
sbc007 = changeField(sbc007, entity = "token", layer = "",
fieldName = "kind",
expression = renameCats(kind, Voc = "Vocalism"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.