Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotmap

Plot Levels of a Variable in a Colour-Coded Map


Description

Plot levels of a variable in a colour-coded map.

Usage

plotmap(values, map, log = FALSE, nclr = 7, include.legend = TRUE, lwd = 0.5, 
round = 3, brks = NULL, legend = NULL, location = "topright", rev = FALSE)

Arguments

values

variable to plot

map

an object of class SpatialPolygons (See SpatialPolygons-class)

log

boolean of whether to plot values on log scale

nclr

number of colour-levels to use

include.legend

boolean of whether to include legend

lwd

line width of borders of areas

round

number of digits to round to in legend

brks

if desired, pre-specified breaks for legend

legend

if desired, a pre-specified legend

location

location of legend

rev

boolean of whether to reverse colour scheme (darker colours for smaller values)

Value

A map colour-coded to indicate the different levels of values.

Author(s)

Albert Y. Kim

See Also

Examples

## Load data
data(scotland)
map <- scotland$spatial.polygon
y <- scotland$data$cases
E <- scotland$data$expected
SMR <- y/E

## Plot SMR
plotmap(SMR, map, nclr=9, location="topleft")

SpatialEpi

Methods and Data for Spatial Epidemiology

v1.2.3
GPL-2
Authors
Cici Chen [ctb], Albert Y. Kim [aut, cre], Michelle Ross [ctb], Jon Wakefield [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.