Re: [R] spliting an integer

From: Berton Gunter <gunter.berton_at_gene.com>
Date: Fri 21 Oct 2005 - 07:25:20 EST

Hint: 11999 = 11999%%1e4 + 1e4*(11999%/%1e4)

"The business of the statistician is to catalyze the scientific learning process." - George E. P. Box    

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Dimitri Szerman
> Sent: Thursday, October 20, 2005 12:40 PM
> To: R-Help
> Subject: [R] spliting an integer
>
> Hi there,
>
> >From the vector X of integers,
>
> X = c(11999, 122000, 81997)
>
> I would like to make these two vectors:
>
> Z= c(1999, 2000, 1997)
> Y =c(1 , 12 , 8)
>
> That is, each entry of vector Z receives the four last digits
> of each entry of X, and Y receives "the rest".
>
> Any suggestions?
>
> Thanks in advance,
>
> Dimitri
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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
>



R-help@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 Received on Fri Oct 21 08:40:42 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 19:14:49 EST