[R] Incorrect Summarization after As.numeric

John Kane jrkrideau at inbox.com
Mon Dec 28 19:32:46 CET 2015


It would likely help to have some sample data. Please have a look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html

John Kane
Kingston ON Canada


> -----Original Message-----
> From: shivi.bhatia at safexpress.com
> Sent: Mon, 28 Dec 2015 14:42:03 +0530
> To: r-help at r-project.org
> Subject: [R] Incorrect Summarization after As.numeric
> 
> Dear Team,
> 
> 
> 
> I am working on aggregate function in R & have used the below code:
> 
> 
> 
> aggregate(a1$Final,list(Year=a1$Year),sum)
> 
> 
> 
> initially a1$Final was factor hence I used a1$Final= as.numeric(a1$Final)
> to
> convert this into numeric. After conversion it shows the output but the
> summarization from the aggregate is incorrect. This I have reconciled
> with
> the excel pivot.
> 
> 
> 
> Could you please suggest where could be the issue?
> 
> 
> 
> Thanks, Shivi
> 
> Mb: 9891002021
> 
> 
> 
> This e-mail is confidential. It may also be legally privileged. If you
> are not the addressee you may not copy, forward, disclose or use any part
> of it. If you have received this message in error, please delete it and
> all copies from your system and notify the sender immediately by return
> e-mail. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!



More information about the R-help mailing list