recodevar(doBy) | R Documentation |
recode levels of variable
Description
Recodes a variable with levels, say '1','2' to a variable with levels, say 'a', 'b'
Usage
recodevar(var, src, tgt)
Arguments
var |
The variable to be recoded |
src |
The source levels: the present levels of var |
tgt |
The target levels: the new levels of var |
Value
A new variable
Examples
x <- c("dec","jan","feb","mar","apr","may") src1 <- list(c("dec","jan","feb"), c("mar","apr","may")) tgt1 <- list("winter","spring") recodevar(x,src=src1,tgt=tgt1)
[Package doBy version 0.0-2 Index]