Re: [R] Mean-Centering Question

2012-12-09 Thread David L Carlson
t; project.org] On Behalf Of arun > Sent: Sunday, December 09, 2012 10:27 AM > To: Ray DiGiacomo, Jr. > Cc: R help > Subject: Re: [R] Mean-Centering Question > > Hi, > > You could also use: > newFunction1<-function(x) {t(t(log(x))-colMeans(log(x)))} > >  res1<-

Re: [R] Mean-Centering Question

2012-12-09 Thread arun
ements for res is data.frame and res1 is matrix.  A.K. - Original Message - From: "Ray DiGiacomo, Jr." To: R Help Cc: Sent: Saturday, December 8, 2012 11:11 PM Subject: Re: [R] Mean-Centering Question Hi David and Arun, Thanks for looking into this.  I think I have fo

Re: [R] Mean-Centering Question

2012-12-08 Thread arun
ay DiGiacomo, Jr." To: R Help Cc: Sent: Saturday, December 8, 2012 6:54 PM Subject: [R] Mean-Centering Question Hello, I'm trying to create a custom function that "mean-centers" data and can be applied across many columns. Here is an example dataset, which is simil

Re: [R] Mean-Centering Question

2012-12-08 Thread Ray DiGiacomo, Jr.
Hi David and Arun, Thanks for looking into this. I think I have found a solution. The "by" function will run ok without errors but the values returned in the second row of the "Los Angeles" output are both incorrect. These incorrect values are shown below in red. I think my original custom fun

Re: [R] Mean-Centering Question

2012-12-08 Thread David Winsemius
On Dec 8, 2012, at 7:06 PM, Elizabeth Fuller Bettini wrote: please remove me from this list. You subscribed and only you know the password that allows you to control the subscription options. Please use the links at the bottom of every posting to Rhelp. On Sat, Dec 8, 2012 at 6:54 PM,

Re: [R] Mean-Centering Question

2012-12-08 Thread David Winsemius
On Dec 8, 2012, at 3:54 PM, Ray DiGiacomo, Jr. wrote: Hello, I'm trying to create a custom function that "mean-centers" data and can be applied across many columns. Here is an example dataset, which is similar to my dataset: dat <- read.table(text="Location,TimePeriod,Units,AveragePrice

Re: [R] Mean-Centering Question

2012-12-08 Thread Elizabeth Fuller Bettini
please remove me from this list. On Sat, Dec 8, 2012 at 6:54 PM, Ray DiGiacomo, Jr. wrote: > R-help@r-project.org [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Mean-Centering Question

2012-12-08 Thread Ray DiGiacomo, Jr.
Hello, I'm trying to create a custom function that "mean-centers" data and can be applied across many columns. Here is an example dataset, which is similar to my dataset: *Location,TimePeriod,Units,AveragePrice* Los Angeles,5/1/11,61,5.42 Los Angeles,5/8/11,49,4.69 Los Angeles,5/15/11,40,5.05 Ne

[R] Mean-Centering Question

2012-12-08 Thread Ray DiGiacomo, Jr.
Hello, I'm trying to create a custom function that "mean-centers" data and can be applied across many columns. Here is an example dataset, which is similar to my dataset: *Location,TimePeriod,Units,AveragePrice* Los Angeles,5/1/11,61,5.42 Los Angeles,5/8/11,49,4.69 Los Angeles,5/15/11,40,5.05 Ne