Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

txt_recode

Recode text to other categories


Description

Recode text to other categories. Values of x which correspond to from[i] will be recoded to to[i]

Usage

txt_recode(x, from = c(), to = c(), na.rm = FALSE)

Arguments

x

a character vector

from

a character vector with values of x which you want to recode

to

a character vector with values of you want to use to recode to where you want to replace values of x which correspond to from[i] to to[i]

na.rm

logical, if set to TRUE, will put all values of x which have no matching value in from to NA. Defaults to FALSE

Value

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

See Also

Examples

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)

udpipe

Tokenization, Parts of Speech Tagging, Lemmatization and Dependency Parsing with the 'UDPipe' 'NLP' Toolkit

v0.8.5
MPL-2.0
Authors
Jan Wijffels [aut, cre, cph], BNOSAC [cph], Institute of Formal and Applied Linguistics, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic [cph], Milan Straka [ctb, cph], Jana Straková [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.