[R] Recoding problem

Peter Flom flom at ndri.org
Mon Dec 8 20:02:15 CET 2003


Hello

I have the following variables, all of which are logicals

fmar15   fcoc15   fher15    fcrk15    fidu15

what I would like is a variable drug15 which equals 
idu if fidu15 is T; crk if fidu15 is F but fcrk is T, her if fher15 is
T but fcrk15 and fidu15 are F and so on

What's the best way to do this?  

Thanks in advance

Peter L. Flom, PhD
Assistant Director, Statistics and Data Analysis Core
Center for Drug Use and HIV Research
National Development and Research Institutes
71 W. 23rd St
www.peterflom.com
New York, NY 10010
(212) 845-4485 (voice)
(917) 438-0894 (fax)




More information about the R-help mailing list