Skip to content
Prev 337559 / 398500 Next

summarize values in R

Hello,

Please send your questions to r-help at r-project.org, the odds of you 
getting more and better answers are greater.

And, why don't you use ?dput to post your data?

As for your question, it seems that ?aggregate solves the problem.

dat <- read.table(text = "
ua ELM PRP
122C MO 5
122C BR 3
122C FA 1
122C MO 1
122D BR 7
122D MO 2
122D BR 1
", header = TRUE)

aggregate(PRP ~ ua + ELM, data = dat, FUN = sum)

Hope this helps,

Rui Barradas

Em 11-03-2014 10:11, catalin roibu escreveu: