[R] Recoding using the memisc package
Shige Song
shigesong at gmail.com
Sun Feb 13 16:05:34 CET 2011
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,
4 -> 1.2,
5 -> 1.3,
6 -> 1.4,
7 -> 1.5,
8 -> 1.6,
9 -> 1.7,
10 -> 1.8,
11 -> 1.9,
12 -> 2.0,
13 -> 2.1,
14 -> 2.2,
15 -> 2.3,
16 -> 2.4,
17 -> 2.5,
18 -> 2.6,
19 -> 2.7,
20 -> 2.8,
21 -> 2.9,
22 -> 3.0,
23 -> 3.1,
24 -> 3.2,
25 -> 3.3,
26 -> 3.4)
})
--------------------------------------------------------------------------
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.
Best,
Shige
More information about the R-help
mailing list