[R] row-wise conditional update in dataframe

2008-01-21 Thread Jon Erik Ween
nd ABCtaskNum) in the function declaration either, but then I haven't quite figured out how best to do variable substitutions in R. Thanks for any help. Cheers Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Heal

Re: [R] row-wise conditional update in dataframe

2008-01-21 Thread Jon Erik Ween
a row. I guess you could do Dataset.target <- apply(x,1,function(.row) sum(is.na(.row))) Thanks Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Health Clinic Baycrest Centre for Geriatric Care Assistant Professor,

Re: [R] row-wise conditional update in dataframe

2008-01-21 Thread Jon Erik Ween
Thanks Jim That got me there. I suppose R prefers absolute field references in scripts rather than macrosubstitutions of field names like you would do in pearl or shell scripts? Anyway, thanks for you help. Cheers Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld

[R] r scripting

2009-06-18 Thread Jon Erik Ween
Hi! I have a dataset with some 300+ variables and 2000+ records. I'd like to grind through a bunch of analyses on the variables by using a script, but can't figure out how to refer to variable names properly. For some of the simpler stuff I use various "apply" functions, but for others (like t-tes