Skip to content
Prev 303158 / 398503 Next

replace funcion

Or if you want to use recode (which you forgot to mention is in package
car):

set.seed(1)
df1<- c(sample(1:12, 50, replace=TRUE)) # sample data

library(car)
recode(df1, "c(1, 2, 3, 4, 11, 12)='invierno'; 5:10='verano'")

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352