rounding | R Documentation |
Given a numeric vector, determine whether the values have been rounded to a certain number of decimal places.
rounding(x)
## Default S3 method:
rounding(x)
x |
A numeric vector, or an object containing numeric spatial coordinates. |
The function rounding
is generic.
Its purpose is to determine whether numerical values have been rounded
to a certain number of decimal places.
The spatstat family of packages provides methods for
rounding
for various spatial objects.
For a numeric vector x
, the default method rounding.default
determines whether the values in x
have been rounded
to a certain number of decimal places.
If the entries of x
are not all integers, then
rounding(x)
returns the smallest number of digits d
after the decimal point
such that round(x, digits=d)
is identical to
x
.
For example if rounding(x) = 2
then the entries of
x
are rounded to 2 decimal places, and are multiples of 0.01.
If all the entries of x
are integers, then
rounding(x)
returns -d
, where
d
is the smallest number of digits before the decimal point
such that round(x, digits=-d)
is identical to
x
.
For example if rounding(x) = -3
then the entries of
x
are multiples of 1000.
If rounding(x) = 0
then the entries of x
are integers
but not multiples of 10.
If all entries of x
are equal to 0, a value of 0 is returned.
An integer.
and \rolf
round.ppp
in package spatstat.geom
.
rounding(c(0.1, 0.3, 1.2))
rounding(c(1940, 1880, 2010))
rounding(0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.