Re: [R] z-transform each column of a data.frame

2012-01-20 Thread William Dunlap
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 > >

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread Steve Lianoglou
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),

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread Martin Batholdy
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

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread R. Michael Weylandt
? 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: > >

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread Gavin Simpson
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

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread Peter Langfelder
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)) > (

[R] z-transform each column of a data.frame

2012-01-20 Thread Martin Batholdy
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