I am working with a medium size dataset and I am interested in recoding several variables at once.
There are 15 variables coded as factors with three levels. YES=3, NO=2, N/A=1. I would like to recode all 15 variables as numeric. YES=1, NO=0, N/A=NA.
Prior to updating my software, this code worked.
my_data[, 9:23 := lapply(.SD, recode, "'YES'=1;'NO'=0;'N/A'=NA", as.factor.result= FALSE), .SDcols = 9:23]
Now I am receiving an error "Error: Argument 2 must be named, not unnamed" Please let me know what I am doing wrong/missing here! Thanks in advance!