[R] How many digits are there in left of dot of 0.0001 ?
ce
zadig_1 at excite.com
Thu Feb 26 04:14:52 CET 2015
No no, I don't want scientific , I want really the number 4 in a variable or cut the 4 out of 1e-04 . I can do it with sub what difficulty is to cut how many characters , one or two
-----Original Message-----
From: "Hasan Diwan" [hasan.diwan at gmail.com]
Date: 02/25/2015 09:55 PM
To: "ce" <zadig_1 at excite.com>
CC: "R Project Help" <r-help at r-project.org>
Subject: Re: [R] How many digits are there in left of dot of 0.0001 ?
Ahh... The exponent of your number in scientific notation, which you can obtain using:
format(a.number, scientific=TRUE)
Hope that helps.. -- H
On 25 February 2015 at 18:43, ce <zadig_1 at excite.com> wrote:
Sorry I meant right. I want to do it R of course. result should be 4 naturally. On the left answer I want would be 1 ,
-----Original Message-----
From: "Hasan Diwan" [hasan.diwan at gmail.com]
Date: 02/25/2015 09:28 PM
To: "R Project Help" <r-help at r-project.org>
Subject: Re: [R] How many digits are there in left of dot of 0.0001 ?
On 25 February 2015 at 17:55, ce <zadig_1 at excite.com> wrote:
> Dear all,
>
> I would like to count how many digits are there on the left of a the dot
> of a numeric variable
>
Left? An infinite number... What does this have to do with R, though? -- H
>
> a=0.0001
>
> thanks
>
> ______________________________________________
> 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.
>
--
OpenPGP: https://hasan.d8u.us/gpg.key
Sent from my mobile device
Envoyé de mon portable
[[alternative HTML version deleted]]
______________________________________________
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
--
OpenPGP: https://hasan.d8u.us/gpg.key
Sent from my mobile device
Envoyé de mon portable
More information about the R-help
mailing list