[R] number of decimal places in a number?

S Ellison S.Ellison at LGCGroup.com
Mon Jul 9 12:52:59 CEST 2012


 

> -----Original Message-----
> From:  Martin Ivanov
> I have the longitudes (lon) and latitudes (lat), and I have a 
> resolution (r), for example r = 0.004. The bounding box must 
> have the same number of digits as resolution. 
Surely the issue is not the particular numeric resolution of the numbers but the idea that the bounding box limits should be integer multiples of the resolution?

Is that not accomplished more straightforwardly by things like
 min <- resol * floor( min(lat)/resol )
 max <- resol * ceil( max(lat)/resol )

?

S Ellison*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list