s-news
[Top] [All Lists]

Re: extract digits

To: s-news@lists.biostat.wustl.edu
Subject: Re: extract digits
From: eggraid <jocelyn.bissonnette@gmail.com>
Date: Thu, 2 Aug 2007 10:59:56 -0700 (PDT)
In-reply-to: <333736.78315.qm@web51408.mail.re2.yahoo.com>
References: <333736.78315.qm@web51408.mail.re2.yahoo.com>
Here's another suggestion if you have many numbers to extract.

the first part can easily be done by using the function "as.integer"
exemple : yourInt <- as.integer(3.25)
or with a vector yourInts<- as.integer(yourVector)

The second part relies on the fisrt one where you simply substract the
integer part of the number to itself
exemple : yourDecs <- 3.25 - yourInt   [ 3.25 - as.integer(3.25)]

Hope this helps.


Ita Cirovic wrote:
> 
> With number 3.25 how do I extract first digit (3) and the decimal (0.25).
> Thanks.
> 
> Ita
> 
> 
> 
>        
> ____________________________________________________________________________________
> Be a better Globetrotter. Get better travel answers from someone who
> knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545469
> 

-- 
View this message in context: 
http://www.nabble.com/extract-digits-tf4204873.html#a11969544
Sent from the S-News mailing list archive at Nabble.com.


<Prev in Thread] Current Thread [Next in Thread>