[R] help

BXC (Bendix Carstensen) bxc at steno.dk
Mon Mar 15 12:53:17 CET 2004


I guess what you want is:

a <- abs(a)
floor( a / 10^floor( log10( a ) ) )

Bendix
----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc
----------------------





> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Manica
> Sent: Friday, March 12, 2004 3:15 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] help
> Importance: High
> 
> 
> 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
> 
> 
> --
> visite
> http://ipimar-iniap.ipimar.pt/neomav/
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> PLEASE 
> do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list