Re: [R] new standardised variable based on group membership

2011-10-03 Thread John.Morrongiello
rk in the future. > > Regards > > John > > -Original Message- > From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] > Sent: Monday, 3 October 2011 6:36 PM > To: Morrongiello, John (CMAR, Hobart); r-help@r-project.org > Subject: RE: [R] new standardised variable ba

Re: [R] new standardised variable based on group membership

2011-10-03 Thread baptiste auguie
> Regards > > John > > -Original Message- > From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] > Sent: Monday, 3 October 2011 6:36 PM > To: Morrongiello, John (CMAR, Hobart); r-help@r-project.org > Subject: RE: [R] new standardised variable based on group membership >

Re: [R] new standardised variable based on group membership

2011-10-03 Thread John.Morrongiello
ello, John (CMAR, Hobart); r-help@r-project.org Subject: RE: [R] new standardised variable based on group membership Dear John, You need to combine scale with a grouping function. data(Orange) library(plyr) Orange <- ddply(Orange, .(Tree), function(x){ x$ddplyAge <- scale(x$age

Re: [R] new standardised variable based on group membership

2011-10-03 Thread ONKELINX, Thierry
ge$aveAge) Best regards, Thierry > -Oorspronkelijk bericht- > Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > Namens john.morrongie...@csiro.au > Verzonden: maandag 3 oktober 2011 7:34 > Aan: r-help@r-project.org > Onderwerp: [R] new standardi

[R] new standardised variable based on group membership

2011-10-03 Thread John.Morrongiello
Hi I have a data comprised of repeated measures of growth (5-15 records per individual) for 580 fish (similar to Orange dataset from nlme library). I would like to standardise these growth measures (yi – ŷ/sd) using mean and standard deviation unique to each fish. Can someone suggest a functi