[R] cumsum function with data frame

2010-06-03 Thread n.via...@libero.it
Dear list, I have a problem with the cumsum function. I have a data frame like the following one variableYear value EC01 2005 5 EC01 2006 10 AAO12005 2 AAO1 2006 4 what I would like to obtain is

Re: [R] cumsum function with data frame

2010-06-03 Thread Joris Meys
See ?split and ?unsplit. Data - read.table(textConnection(variableYear value EC01 2005 5 EC01 2006 10 AAO12005 2 AAO1 2006 4),header=T) Datalist -split(Data,Data$variable) resultlist -

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
-project.org Sent: Thu, June 3, 2010 9:26:17 AM Subject: Re: [R] cumsum function with data frame See ?split and ?unsplit. Data - read.table(textConnection(variable        Year      value EC01            2005        5 EC01            2006        10 AAO1            2005          2 AAO1

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
,CUMSUM=cumsum(value))   - Original Message From: Felipe Carrillo mazatlanmex...@yahoo.com To: Joris Meys jorism...@gmail.com; n.via...@libero.it n.via...@libero.it Cc: r-help@r-project.org Sent: Thu, June 3, 2010 11:28:58 AM Subject: Re: [R] cumsum function with data frame You can

Re: [R] cumsum function with data frame

2010-06-03 Thread Jorge Ivan Velez
...@gmail.com; n.via...@libero.it n.via...@libero.it Cc: r-help@r-project.org Sent: Thu, June 3, 2010 11:28:58 AM Subject: Re: [R] cumsum function with data frame You can also use ddply from the plyr package: library(plyr) Data - read.table(textConnection(variableYear value

Re: [R] cumsum function with data frame

2010-06-03 Thread Joris Meys
: [R] cumsum function with data frame You can also use ddply from the plyr package: library(plyr) Data - read.table(textConnection(variable    Year  value EC01 2005    5 EC01    2006    10 AAO1    2005 2 AAO1  2006 4),header=T) Data ddply

Re: [R] cumsum function with data frame

2010-06-03 Thread Jorge Ivan Velez
-help@r-project.org;r-help@r-project.org Sent: Thu, June 3, 2010 9:26:17 AM Subject: Re: [R] cumsum function with data frame See ?split and ?unsplit. Data - read.table(textConnection(variableYear value EC01 2005 5 EC012006