Is there a way to use the dpylr recoding function along with a lookup table (data.frame or list)?
What I would like to have would look something like this:
# Recode values with list of named arguments data <- sample(c("a", "b", "c", "d"), 10, replace = T) lookup <- list(a = "Apple", b = "Pear") dplyr::recode(data, lookup)
I found mapvalues and revalue from the plyr package. Combining them is possible, as described here . However, I am wondering if something like this is possible with dplyr.
source share