Learn R Programming

raster (version 1.7-23)

as.logical: Change values to logical

Description

Change values of a Raster* object to logical values (zero becomes FALSE, all other values become TRUE) You can provide the standard additional arguments: filename, format, overwrite, and progress.

Arguments

See Also

as.logical

Examples

Run this code
r <- raster(nrow=10, ncol=10)
r[] <- round(runif(ncell(r)))
r <- as.logical(r)

Run the code above in your browser using DataLab