categorize: Categorizing continious data

Description Usage Arguments Details Value Author(s) References Examples

Description

A function to categorize (discretize) numerical data in the form of a raster layer, or a vector.

Usage

1

Arguments

x

A RasterLayer or a numerical vector

nc

Number of classes, if missing, it will be automatically detected

...

Additional parameters for writeRaster function (filename should be specified as additional argument)

Details

If nc is not specified, the function calls the function nclass to find the best number of classes. For the details of how nclass works, see the reference.

Value

RasterLayer

if x is a RasterLayer

numeric vector

if x is a numeric vector

Author(s)

Babak Naimi naimi.b@gmail.com

http://r-gis.net

References

Naimi. B. et al. (under review) ELSA: An Entropy-based Local indicators of Spatial Association, Geographical Analysis;

Examples

1
2
3
4
5
6
7
categorize(1:10,3) # categorizeing a numeric vector into 3 categories

file <- system.file('external/dem_example.grd',package='elsa')
r <- raster(file)
plot(r,main='a continuous raster map')
rc <- categorize(r,nc=4)
plot(rc, main='categorized map')

elsa documentation built on May 2, 2019, 4:49 p.m.

Related to categorize in elsa...