dunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of Martin Batholdy
> Sent: Friday, January 20, 2012 9:17 AM
> To: R Help
> Subject: Re: [R] z-transform each column of a data.frame
>
>
Hi Martin,
On Fri, Jan 20, 2012 at 12:04 PM, Martin Batholdy
wrote:
> Hi,
>
>
> I am currently trying to z-transform (that is subtracting the mean and divide
> by the standard deviation) multiple columns of a data.frame at the same time.
>
>
> My first approach was:
>
> x <- data.frame(c(0:10),
great, thank you!
On 20.01.2012, at 18:10, R. Michael Weylandt wrote:
> ? scale
> apply(x, 2, scale)
>
> Michael
>
> On Fri, Jan 20, 2012 at 12:04 PM, Martin Batholdy
> wrote:
>> Hi,
>>
>>
>> I am currently trying to z-transform (that is subtracting the mean and
>> divide by the standard
? scale
apply(x, 2, scale)
Michael
On Fri, Jan 20, 2012 at 12:04 PM, Martin Batholdy
wrote:
> Hi,
>
>
> I am currently trying to z-transform (that is subtracting the mean and divide
> by the standard deviation) multiple columns of a data.frame at the same time.
>
>
> My first approach was:
>
>
On Fri, 2012-01-20 at 18:04 +0100, Martin Batholdy wrote:
> Hi,
>
>
> I am currently trying to z-transform (that is subtracting the mean and divide
> by the standard deviation) multiple columns of a data.frame at the same time.
>
>
> My first approach was:
>
> x <- data.frame(c(0:10), c(10:20
On Fri, Jan 20, 2012 at 9:04 AM, Martin Batholdy
wrote:
> Hi,
>
>
> I am currently trying to z-transform (that is subtracting the mean and divide
> by the standard deviation) multiple columns of a data.frame at the same time.
>
>
> My first approach was:
>
> x <- data.frame(c(0:10), c(10:20))
> (
Hi,
I am currently trying to z-transform (that is subtracting the mean and divide
by the standard deviation) multiple columns of a data.frame at the same time.
My first approach was:
x <- data.frame(c(0:10), c(10:20))
(x - colMeans(x)) / apply(x, 2, sd)
This is obviously not working.
Is th
7 matches
Mail list logo