mapBiPolar: Function: Map a bipolar theme broken around a neutral value

Description Usage Arguments Details Value Author(s) Examples

View source: R/mapBiPolar.R

Description

mapBiPolar generates a map of a bipolar theme variable

Usage

1
2
3
mapBiPolar(var.name,shape, break.value=0, neg.breaks=4, pos.breaks=neg.breaks,
                  map.title="", legend.title=deparse(substitute(var.name)),
                  legend.pos="bottomleft", legend.cex=1, add.to.map=FALSE)

Arguments

var.name

A variable to be mapped in a bipolar theme. If it is in a data-frame, then the data-frame must be refered to, e.g., df$var

shape

An existing spatial polygon or spatial polygon data-frame

break.value

Neutral value separating the negative branch from the positive branch of the variable

neg.breaks

Number of classes in the negative branch (default=4)

pos.breaks

Number of classes in the positive branch (default=neg.breaks)

map.title

Character string with map title

legend.title

Character string with legend title (default=var.name)

legend.pos

Location of legend in the map frame (default="bottomleft")

legend.cex

Relative font size of the legend

add.to.map

Logical to start a new map frame if FALSE or overlay onto an existing map frame if TRUE

Details

The function mapBiPolar maps a bipolar variable with a divergent color ramp around a specific break values. A legend is generated. Below values are coded blue and above values red. Each branch is broken into 'quantiles'. Therefore, the number of class in each branch should be proportional to the number of observations in each class. NA's are permitted.

Value

NULL

Author(s)

Michael Tiefelsdorf <tiefelsdorf@utdallas.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(maptools)
validTractShp <- tractShp[!is.na(tractShp$BUYPOW), ]         # Remove 2 tracts with NA's
mapColorQual(validTractShp$CITYPERI, validTractShp,
             map.title="Cities and Peripherie in Dallas County",
             legend.title="Regions")

mapColorRamp(validTractShp$bad1500D, validTractShp, breaks=9,
             map.title="Density of Convenience Stores in Dallas County\nbw=1500 meters",
             legend.title="Junk Food")

hist(tractShp$LRRmedD)
mapBiPolar(validTractShp$LRRmedD, validTractShp, break.value=0,
           neg.breaks=5, pos.breaks=5,
           map.title="LRR: log(f(junk food),f(healthy food))\nbw=medium",
           legend.title="log relative risk")

TexMix documentation built on March 1, 2020, 5:10 p.m.