Try something like this:
# get column numbers of 'wk' columns
col.num <- grep("^wk", names(yourDF))
# split out only the 'wk' columns
result <- lapply(split(yourDF[, col.num], paste(yourDF$x2,
paste(yourDF$x3))), function(.mrg){
colSums(.mrg)
})
On Thu, Nov 5, 2009 at 4:15 PM, Vadlamani, Sat
Tena koe Satish
I'm not entirely sure what you want, but did you check aggregate()?
HTH
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Vadlamani,
> Satish {FLNA}
> Sent: Friday, 6 November 2009 10:16 a
2 matches
Mail list logo