plotMap | R Documentation |
Plot the polygons in a SpatialPolygonsDataFrame
object, and turn the values of a quantitative feature into colors over individual polygons.
plotMap( map, feat, color = topo.colors(10), main = "", bar_title = "rank", zlim = NULL )
map |
|
feat |
numberic vector having the same elements as the number of polygons in the input |
color |
vector of distinct colors for converting values of |
main |
character specifying the main title. |
bar_title |
character specifying the text over the color bar. |
zlim |
length-2 numeric vector specifying the range of values to be converted. |
A colored map.
SpatialPolygonsDataFrame
require(sp) grd <- GridTopology(c(1,1), c(1,1), c(5,5)) polys <- as(grd, "SpatialPolygons") centroids <- coordinates(polys) gdomain <- SpatialPolygonsDataFrame(polys, data=data.frame(x=centroids[,1], y=centroids[,2], row.names=row.names(polys))) feat <- gdomain$x*5+gdomain$y^2 plotMap(gdomain,feat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.