Shige Song wrote: > > Dear All, > > I am trying to recode a variable using the functions provided by > "memisc" package. Actually I am following the examples on page 9-10 of > the vignette: > > -------------------------------------------------------------------------- > d.fig <- within(d.fig,{ > sev <- recode(sev, > 1 -> 0.9, > 2 -> 1.0, > 3 -> 1.1, > ... and more > }) > -------------------------------------------------------------------------- > > I keep get error message saying "Error in 0.9 <- 1 : invalid (do_set) > left-hand side to assignment." Any idea what is going on? Thanks. >
Please, make a shorter example and provide a data set. This works for me; library(memisc) d.fig = data.frame(sev=c(1,2,3)) d.fig <- within(d.fig,{ sev <- recode(sev, 1 -> 0.9, 2 -> 1.0) }) -- View this message in context: http://r.789695.n4.nabble.com/Recoding-using-the-memisc-package-tp3303700p3303742.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.