Description Usage Arguments Value Examples
The choropleth
function discretizes the values of a quantity based
on their quantiles.
1 | choropleth(x, values, k = 10, ...)
|
x |
An object of the class SpatialPolygonsDataFrame. |
values |
The column in the SpatialPolygonsDataFrame for which to discretize the values of the quantity. |
k |
Numeric, the desired number of bins to discretize. |
... |
Further arguments passed to or from other methods. |
choropleth |
returns a SpatialPolygonsDataFrame with a column with the discretized values
1 2 3 4 5 6 7 8 9 10 | require(raster)
s <- readRDS(system.file("nigeria/SR_Naija.rds", package= "bioregion"))
k=10
COLOUR <- colorRampPalette(c("blue", "yellow", "red"))(k)
y = choropleth(s, values=s$SR, k)
## Not run:
plot(y, col=COLOUR[y$values], border = NA)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.