| rounding.ppp {spatstat.geom} | R Documentation |
Detect Numerical Rounding
Description
Given a numeric vector, or an object containing numeric spatial coordinates, determine whether the values have been rounded to a certain number of decimal places.
Usage
## S3 method for class 'ppp'
rounding(x)
## S3 method for class 'pp3'
rounding(x)
## S3 method for class 'ppx'
rounding(x)
Arguments
x |
A point pattern (object of class |
Details
The functions documented here are methods for the generic
rounding.
They determine whether the coordinates of a spatial object
have been rounded to a certain number of decimal places.
-
If the coordinates of the points in
xare not all integers, thenrounding(x)returns the smallest number of digitsdafter the decimal point such thatround(coords(x), digits=d)is identical tocoords(x). For example ifrounding(x) = 2then the coordinates of the points inxappear to have been rounded to 2 decimal places, and are multiples of 0.01. -
If all the coordinates of the points in
xare integers, thenrounding(x)returns-d, wheredis the smallest number of digits before the decimal point such thatround(coords(x), digits=-d)is identical tocoords(x). For example ifrounding(x) = -3then the coordinates of all points inxare multiples of 1000. Ifrounding(x) = 0then the entries ofxare integers but not multiples of 10. -
If all coordinates of points in
xare equal to 0, a value of 0 is returned.
Value
An integer.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Rolf Turner rolfturner@posteo.net
See Also
Examples
rounding(cells)