[R] Optimal method to scan cells and set flag

2010-12-16 Thread Jon Erik Ween
1 Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre Assistant Professor, Dept. of Medicine, Div. of Ne

Re: [R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
is then translated into a z-score in a second table. My DSTz table combines these two steps, going from the raw score to the tabulated age-adjusted z-score that was calculated based on a normative sample by the WMS-R folks. Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld

Re: [R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
mailto:r-help-boun...@r-project.org] On Behalf Of Jon Erik Ween >> Sent: Thursday, December 09, 2010 8:27 AM >> To: David Winsemius >> Cc: r-help@r-project.org >> Subject: Re: [R] set dataframe field value from lookup table >> >> Sorry, I should have included

Re: [R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
object length is not a multiple of shorter object length So, regardless of how you calculate [r,c], the step df$DSTz<-DSTzlook[r,c] doesn't work. I've tried various permutations with "apply", but that didn't work either. Any suggestions? Jon Soli Deo Gloria Jon Eri

Re: [R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
But it is the indirect referencing of the lookup in the main table that causes me trouble. Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre Assistant Professor, Dept. of Medicine, Div. of Neu

Re: [R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
.8 2.6 2.6 27 0.0 0.5 1.0 1.8 2.6 2.6 26 -.5 0.0 0.0 1.0 1.8 2.6 . . . . So, if a subject (row) has age==29 and a standard score of 28, the value should be 1.8, etc. Thanks Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Strok

[R] set dataframe field value from lookup table

2010-12-09 Thread Jon Erik Ween
Hi This is (hopefully) a bit more cogent phrasing of a previous post. I'm trying to compute a z-score to rows in a large dataframe based on values in another dataframe. Here's the script (that does not work). 2 questons, 1) Anyone know of a more elegant way to calculate the "rounded" age value t

[R] change matrix based on look-up value from table

2010-12-08 Thread Jon Erik Ween
Hi! I have a large dataset where I need to recompute a value in each row based on z-sores from another look-up table. The look-up table is arranged by raw score in the first column and age in the first row, eg: 20 30 40 1 .3 .5 .7 2 .2 .3 .4 3 .1 .4 .7 the main matrix will have ages

Re: [R] generate list of variable names

2010-06-09 Thread Jon Erik Ween
[[j]], MSsmv$Issue_cat); # Don't put any real results here, they don't seem to be passed back perf<-performance(pred,"auc"); } ### Cheers Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brai

[R] generate list of variable names

2010-06-09 Thread Jon Erik Ween
be welcome. Thanks! Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre Assistant Professor, Dept. of Medicine, Div. of Neurology University of Toronto Faculty of Medicine Kimel Family Build

Re: [R] variable substitution in for loops

2010-03-02 Thread Jon Erik Ween
The @ operator is defined for slots of *S4* classes. Best, Uwe Ligges > Hence, you pull out the the auc value in ROCR-"performance" by p...@y.value > in the script. you can see what slots are in an object by simply listing the > object contents at the command line>obje

Re: [R] variable substitution in for loops

2010-03-01 Thread Jon Erik Ween
ommand line >object. Thanks again for all the help! Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Health Clinic, Baycrest Centre Assistant Professor, Dept. of Medicine, Div. of Neurology Un

Re: [R] variable substitution in for loops

2010-02-24 Thread Jon Erik Ween
David Thanks for your suggestions. "Reproducible examples", my datasets are too big so I'm not sure what you would want to see. Anyway, does this help: dataset: Perf_Index Age risk_score gender hight IQ ... 12 78 10 m 6 110 ... 10 77 9 f 6 97 ... 5 64 f 13 5 120 ... ... varslist: Perf_Index Ag

[R] variable substitution in for loops

2010-02-24 Thread Jon Erik Ween
ve tried space separated, comma separated, tab separated lists and all give the same error. I've tried get(), parse()... no go. Any suggestions? Thanks a lot Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Research Unit Director, Stroke Clinic, Brain Hea

[R] variable substitution

2010-02-18 Thread Jon Erik Ween
#Example script varlist<-read.table(/path/to/varlist) for (i in 1:length(varlist)){ res<-mean(Dataset$SOMETHINGHERE_i ) write(res) somewhere } Something like that. Any suggestions? Thanks Jon Soli Deo Gloria Jon Erik Ween, MD, MS Scientist, Kunin-Lunenfeld Applied Re

[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

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

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,

[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