t; To: r-help@r-project.org
> Subject: [R] Scaling a column in groups
>
>
>
> Hello R people
>
> I have a column of numeric values that are grouped in blocks
> of 25 and to be centered and scaled within each block. (That
> is subtract the mean and divide by the standa
Try this:
c(apply(matrix(testdata, 25), 2, scale))
On Nov 16, 2007 9:20 AM, john seers (IFR) <[EMAIL PROTECTED]> wrote:
>
> Hello R people
>
> I have a column of numeric values that are grouped in blocks of 25 and
> to be centered and scaled within each block. (That is subtract the mean
> and div
Hello R people
I have a column of numeric values that are grouped in blocks of 25 and
to be centered and scaled within each block. (That is subtract the mean
and divide by the standard deviation.)
Is there a neater way to do this? i.e not using a loop?
Example looped code:
testdata<-1:100
cs
Ah, that is neat.
Thanks.
JS
-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
Sent: 16 November 2007 15:12
To: john seers (IFR)
Cc: r-help@r-project.org
Subject: Re: [R] Scaling a column in groups
Try this:
c(apply(matrix(testdata, 25), 2, scale))
On Nov 16
4 matches
Mail list logo