txt_recode | R Documentation |
Recode text to other categories.
Values of x
which correspond to from[i]
will be recoded to to[i]
txt_recode(x, from = c(), to = c(), na.rm = FALSE)
x |
a character vector |
from |
a character vector with values of |
to |
a character vector with values of you want to use to recode to where you
want to replace values of |
na.rm |
logical, if set to TRUE, will put all values of |
a character vector of the same length of x
where values of x
which are given in from
will be replaced by the corresponding element in to
match
x <- c("NOUN", "VERB", "NOUN", "ADV") txt_recode(x = x, from = c("VERB", "ADV"), to = c("conjugated verb", "adverb")) txt_recode(x = x, from = c("VERB", "ADV"), to = c("conjugated verb", "adverb"), na.rm = TRUE) txt_recode(x = x, from = c("VERB", "ADV", "NOUN"), to = c("conjugated verb", "adverb", "noun"), na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.