[R] Summing Data in R

William Dunlap wdunlap at tibco.com
Tue Dec 27 20:22:49 CET 2011


Your command includes (at about character position 240):
  'R.N.S.1ST',R.N.S.2ND'
Note the missing quote after the comma.

When R's error message starts with
  Error:
instead of
  Error in <command>:
it usually means it could not parse the text that you typed
to make a command out of it.  (Perhaps it should say 'Error
while parsing input text'.)

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of steven.hazen
> Sent: Tuesday, December 27, 2011 10:01 AM
> To: r-help at r-project.org
> Subject: Re: [R] Summing Data in R
> 
> 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.Q
> TA','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,dstat
> s$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.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list