recode.sdf | R Documentation |
Recodes variables in an edsurvey.data.frame
,
a light.edsurvey.data.frame
, or an edsurvey.data.frame.list
.
recode.sdf(x, recode)
x |
an |
recode |
a list of recoding rules. See Examples for the format of recoding rules. |
an object of the same class as x
with the recode
added to it
Trang Nguyen and Paul Bailey
## Not run:
# filepath argument will vary by operating system conventions
usaG4.15 <- readTIMSS(path="~/TIMSS/2015", "usa", 4)
d <- getData(usaG4.15, "itsex")
summary(d) #show details: MALE/FEMALE
usaG4.15 <- recode.sdf(usaG4.15,
recode = list(itsex=list(from=c("MALE"),
to=c("BOY")),
itsex=list(from=c("FEMALE"),
to=c("GIRL"))))
d <- getData(usaG4.15, "itsex") #apply recode
summary(d) #show details: BOY/GIRL
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.