as.logical

0th

Percentile

Change cell values to logical or integer values

Change values of a Raster* object to logical or integer values. With as.logical, zero becomes FALSE, all other values become TRUE. With as.integer values are truncated.

Keywords
methods, spatial
Usage
# S4 method for Raster
as.logical(x, filename='', ...)

# S4 method for Raster as.integer(x, filename='', ...)

Arguments
x

Raster* object

filename

character. Output filename (optional)

...

additional optional arguments as for writeRaster

See Also

logical, integer

Aliases
  • as.logical,Raster-method
  • as.integer,Raster-method
Examples
# NOT RUN {
r <- raster(nrow=10, ncol=10)
set.seed(0)
r[] <- runif(ncell(r)) * 10
r
r <- as.integer(r)
r
as.logical(r)
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.