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.
|