[R] help

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Mon Mar 15 11:40:44 CET 2004


On 12-Mar-04 Manica wrote:
> I want to extract the first non-zero digit of any vector, as for
> example
> from a<-runif(100,0,1).
> Tried it using grep (...) but didn´t work.
> 
> Any help is very much appreciated.
> Thanks,
> Manica

runif will put "real" numbers in 'a'. It is highly likely that
any of them will be zero, and in any case they are not "digits"
(though in their decimal representation many of them will have
at least one "0" in the string of digits for each one).

So it is not clear what you mean by "the first non-zero digit
of any vector". Please clarify!

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 15-Mar-04                                       Time: 10:40:44
------------------------------ XFMail ------------------------------




More information about the R-help mailing list