ColorMap: Plot Levels of a Variable in a Colour-Coded Map

Description Usage Arguments Author(s) Examples

Description

Plot Levels of a Variable in a Colour-Coded Map

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ColorMap(values, map = NULL, polys = NULL, log = FALSE, nclr = 7, 


    include.legend = list(TRUE), round = 3, brks = NULL, legend = NULL, 


    location = "topright", rev = FALSE, alpha = 0.5, GRAY = FALSE, 


    palette = c("YlOrRd", "RdYlGn", "Spectral")[1], textInPolys = NULL, 


    ...)

Arguments

values

variable to plot

map

map object

polys

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

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)

alpha

alpha value of colors

GRAY

boolean: if TRUE, use gray scale instead

palette

palette to choose from RColorBrewer

textInPolys

text to be displayed inside polygons. This can be a column names for values

...

extra args to pass to PlotPolysOnStaticMap

Author(s)

Markus Loecher

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  if (interactive()){


  data("NYleukemia", envir = environment())


  population <- NYleukemia$data$population


  cases <- NYleukemia$data$cases


  mapNY <- GetMap(center=c(lat=42.67456,lon=-76.00365), destfile = "NYstate.png", 


                  maptype = "mobile", zoom=9)


  ColorMap(100*cases/population, mapNY, NYleukemia$spatial.polygon, add = FALSE,


           alpha = 0.35, log = TRUE, location = "topleft")


}


  #ColorMap(100*cases/population, map=NULL, NYleukemia$spatial.polygon)


  

RgoogleMaps documentation built on May 31, 2017, 2:54 a.m.