[R] how to do this sum?

Petr Pikal petr.pikal at precheza.cz
Mon Jun 19 13:43:56 CEST 2006


Hi

sum(as.numeric(table_x[,3]), na.rm=T)

shall help (maybe)

HTH
Petr




On 19 Jun 2006 at 19:05, GuangXing wrote:

Date sent:      	Mon, 19 Jun 2006 19:05:51 +0800
From:           	"GuangXing" <guangxing at ict.ac.cn>
To:             	"Dr L. Y Hin" <lyhin at netvigator.com>
Copies to:      	"r-help at stat.math.ethz.ch" <r-help at stat.math.ethz.ch>
Subject:        	Re: [R] how to do this sum?

> I am sorry for my ignorance.
> table_x is defined as follow:
> >table_x<-read.table("stat.txt")
> in the stat.txt,there are 5  cols,there are so many big intergers in
> the every cols. Now, I want to to that: >sum(table_x[,3]) But it does
> not work. How can I? Pls help me! ------------------				 GuangXing
> 2006-06-19
> 
> -------------------------------------------------------------
> ˙˘ĽţČËŁşDr L. Y Hin
> ˙˘ËÍČŐĆÚŁş2006-06-19 17:16:04
> ĘŐĽţČËŁşGuangXing
> ł­ËÍŁş
> Ö÷Ě⣺Re: [R] how to do this sum?
> 
> Of course.
> table_x means assign x to the function called table.
> if you call the table by the name table.x, it will
> probably do the job.
> 
> ----- Original Message ----- 
> From: "GuangXing" <guangxing at ict.ac.cn>
> To: <r-help at stat.math.ethz.ch>
> Sent: Monday, June 19, 2006 6:17 PM
> Subject: [R] how to do this sum?
> 
> 
> > Hi, Everybody!
> > I have a big table which named table_x, and all the elements in the
> > table is very large! Now I want to do the summay on the talbe_x[,3].
> > Unfornately, I can't get the right result! And the R give the
> > warning messages as follow:
> >> sum(table_x[,3])
> >>[1] NA
> >>Warning message:
> >>interger overflow in sum(.);please use sum(as.numeric(.))
> > (the original upper message is Chinese,and I have translated those
> > to English.)
> >
> > Any one tell me how to use the as.numeric(.)?
> > And I want to know does R support the 64bits interger?How to do? Pls
> > forgive my ignorance.
> >
> > Thank you in advance!
> > --------------
> > GuangXing
> > 2006-06-19
> >
> >
> 
> 
> ----------------------------------------------------------------------
> ----------
> 
> 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> 
> 

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list