[R-sig-Geo] Trouble with leglabs()

Roger Bivand Roger.Bivand at nhh.no
Thu Jun 9 22:59:11 CEST 2005


On Fri, 10 Jun 2005, Susumu Tanimura wrote:

> Hi there,
> 
> This may be a silly question here, but I cannot solve a problem with
> leglabs().  
> 
> > breaks <- c(0,300000, 600000, 900000,1200000,10000000)
> > leglabs(breaks)
> [1] "under 3e+05"     "3e+05 - 6e+05"   "6e+05 - 9e+05"   "9e+05 - 1200000"
> [5] "over 1200000"
> 
> I do not need exponential expression but sequential zero.  It is very
> happy if you give me some advice.

I think you can convert the input vector to character first, using for 
example the base formatC() function:

> leglabs(formatC(breaks, digits=0, format="f"))
[1] "under 300000"     "300000 - 600000"  "600000 - 900000"  "900000 - 1200000"
[5] "over 1200000"  

is probably close to your needs.

> 
> --
> Susumu Tanimura
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list