Re: [R] Tranpose and Aggregate Data - now Reshape - cast

2010-01-05 Thread Noli Sicad
library(reshape) names(harvest.dat) = c("CROP_ID", "CROPTYPE", "PERIOD","CUT_AGE") harvest <-cast(harvest.dat, CROP_ID + CROPTYPE ~ PERIOD) It seems that I am getting the frequencies instead of the individual values. Output ~ CROP_ID CROPTYPE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Schalk, Thank you very much for this. Noli On 1/5/10, Schalk Heunis wrote: > Hi > > You can use the reshape package to achieve this. If you don't have it > installed, install.packages('reshape'). Then look at ?cast and (possibly) > ?melt > HTH! > > Schalk > > > On Tue, Jan 5, 2010 at 7:59 AM

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Schalk Heunis
Hi You can use the reshape package to achieve this. If you don't have it installed, install.packages('reshape'). Then look at ?cast and (possibly) ?melt HTH! Schalk On Tue, Jan 5, 2010 at 7:59 AM, Noli Sicad wrote: > Hi, > > I need to transpose and aggregate the 4th and 5th column of this d

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Sorry, the second email is accidently sent. Yes, the Cut Area should not be included in the data in the first email. The second email has a correct data. Thanks. Noli __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
> From: > P_ID CROP Period Ini_Age CROP_ID CROPTYPEPeriod Ini_Age 83 SORI 131 84 SORI1 32 85 SORI 1 33 86 SORI 1 34 82 SORI 2 28 83 SORI 2 29 84 SORI 2 30 93 SORM2 35 62

[R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Hi, I need to transpose and aggregate the 4th and 5th column of this data set (below). The period is 1 to 100 years and some period has 1 entry as shown in the example below. Any ideas how to do this. Thanks in advance. Noli ~~ From: P_ID CROP Period Ini_Age Area_Cut 83 SORI