round

0th

Percentile

Integer values

These functions take a single RasterLayer argument x and change its values to integers.

ceiling returns a RasterLayer with the smallest integers not less than the corresponding values of x.

floor returns a RasterLayer with the largest integers not greater than the corresponding values of x.

trunc returns a RasterLayer with the integers formed by truncating the values in x toward 0.

round returns a RasterLayer with values rounded to the specified number of digits (decimal places; default 0).

Keywords
spatial
Details

see ?base::round

Value

a RasterLayer object

Methods

ceiling(x) floor(x) trunc(x, ...) round(x, digits = 0)

x

a RasterLayer object

digits

integer indicating the precision to be used

...

additional arguments

See Also

round

Aliases
  • round,RasterLayer-method
  • trunc,RasterLayer-method
  • ceiling,RasterLayer-method
  • floor,RasterLayer-method
Examples
# NOT RUN {
r <- raster(ncol=10, nrow=10)
r[] <- runif(ncell(r)) * 10
s <- round(r)

# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.