Skip to content
Prev 71 / 885 Next

R Equivalent of SPSS "Split File" and "AutoRecode"

The code is so long... Why not store the labels in another file and
read them into a vector, then assign labels to columns in a loop?

To split file means you have to do the same procedure on each subset
of the data - this is easy in R: what you need are the splitting
variable and corresponding conditions, then apply your functions to
the subset of data in a loop (or use sapply(), ...)

For autorecode, it is nothing but factor() in R!

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China
On Fri, Nov 14, 2008 at 7:31 AM, Albyn Jones <jones at reed.edu> wrote: