[R] Recoding lists of categories of a variable

S Ellison S.Ellison at LGCGroup.com
Mon Oct 10 18:08:40 CEST 2016


> Is there a convenient way to edit this code to allow me to recode a list of
> categories 'topic 1', 'topic 9' and 'topic 14', say, of the the old variable 'oldvar'
> as 'parenttopic' by means of the new variable 'newvar', while also mapping
> system missing values to system missing values?

You could look at 'recode()' in the car package.

There's a fair description of other options at http://www.uni-kiel.de/psychologie/rexrepos/posts/recode.html

S Ellison




*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list