[R] Summing Data in R

steven.hazen steven.hazen at msu.montana.edu
Tue Dec 27 19:01:14 CET 2011


Yes that is what I'm trying to do, however when I enter the code 

aggregate(dstats[,c('QUOTA','L.R.QTA','L.R.A.1ST','L.R.S.1ST','L.N.QTA','L.N.A.1ST','L.N.S.1ST','R.R.QTA','R.R.A.1ST','R.R.A.2ND','R.R.A.3RD','R.R.S.1ST','R.R.S.2ND','R.R.S.3R','R.N.QTA','R.N.A.1ST','R.N.A.2ND','R.N.A.3RD','R.N.S.1ST',R.N.S.2ND','R.N.S.3RD','T.SUCCESS','T.SURPLUS')],list(dstats$Year,dstats$HD),FUN=sum)

I'm getting an error message saying:

 Error: unexpected string constant in
"aggregate(dstats[,c('QUOTA','L.R.QTA','L.R.A.1ST','L.R.S.1ST','L.N.QTA','L.N.A.1ST','L.N.S.1ST','R.R.QTA','R.R.A.1ST','R.R.A.2ND','R.R.A.3RD','R.R.S.1ST','R.R.S.2ND','R.R.S.3R','R.N.QTA','R.N."
> 
Any suggestions on how to fix this?

Thanks,
Steve

--
View this message in context: http://r.789695.n4.nabble.com/Summing-Data-in-R-tp4237650p4237796.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list