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

2010-12-09 Thread Jon Erik Ween
wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [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:

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 William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [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 va

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

2010-12-09 Thread David Winsemius
Offlist comments No reply needed .. This is just for emphasis and clarification. On Dec 9, 2010, at 11:19 AM, Jon Erik Ween wrote: David I see how findInterval is a more elegant way of doing 1). I'd need to change the indices in the lookup table, as findInterval(36, c(0, 17, 19, 24, 29, 3

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

2010-12-09 Thread David Winsemius
On Dec 9, 2010, at 11:27 AM, Jon Erik Ween wrote: Sorry, I should have included the error I get when using the initial vesion of step 2): Error in `$<-.data.frame`(`*tmp*`, "DSTz", value = list(Age7 = c(-1.55, : replacement has 20 rows, data has 955 In addition: Warning message: In DSTz

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

2010-12-09 Thread Jon Erik Ween
Sorry, I should have included the error I get when using the initial vesion of step 2): Error in `$<-.data.frame`(`*tmp*`, "DSTz", value = list(Age7 = c(-1.55, : replacement has 20 rows, data has 955 In addition: Warning message: In DSTzlook[, 1] == df$DSF + df$DSB : longer object length is

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

2010-12-09 Thread Jon Erik Ween
David I see how findInterval is a more elegant way of doing 1). I'd need to change the indices in the lookup table, as > findInterval(36, c(0, 17, 19, 24, 29, 34, 44, 54, 64, 69, 74, 79, 84, 89) ) [1] 6 should be 7, not 6. The age range for the 7th column 35-44. But that's easy. I can't see ho

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

2010-12-09 Thread David Winsemius
On Dec 9, 2010, at 10:51 AM, Jon Erik Ween wrote: Thanks David What I am trying to do is set up a script that assigns z-scores to a large dataframe (2500x300, but has Age in years and test scores as columns.) from a published table of age-corrected standard scores on this cognitive test.

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

2010-12-09 Thread David Winsemius
On Dec 9, 2010, at 10:33 AM, David Winsemius wrote: On Dec 9, 2010, at 9:34 AM, Jon Erik Ween wrote: 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 scrip

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

2010-12-09 Thread Jon Erik Ween
Thanks David What I am trying to do is set up a script that assigns z-scores to a large dataframe (2500x300, but has Age in years and test scores as columns.) from a published table of age-corrected standard scores on this cognitive test. 1) The age intervals in the lookup table are given and n

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

2010-12-09 Thread David Winsemius
On Dec 9, 2010, at 9:34 AM, Jon Erik Ween wrote: 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

[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