map.plot: map.plot

Description Usage Arguments Details Value Author(s) Examples

Description

Plot Maps

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  map.plot(data, variable = NULL, longitude = "long",
    latitude = "lat", fill.color.low = muted("red"),
    fill.color.mid = "white",
    fill.color.high = muted("green"), space = "Lab",
    midpoint = mean(data[[variable]], na.rm = TRUE),
    path.color = "white", title = NULL, title.size = 15,
    title.hjust = 0.5, xlab = NULL, ylab = NULL,
    barheight = 15, formatter = percent,
    legend.position = c("right", "bottom", "left", "top", "none"),
    lhs = NULL, rhs = NULL,
    facet = c("none", "facet_wrap", "facet_grid"),
    wrap.nrow = NULL, wrap.ncol = NULL,
    scales = c("fixed", "free", "free_y", "free_x"),
    gradient = "2")

Arguments

data

data.frame resulting from using fortify on a shapefile object.

variable

Character indicating which column should be plotted.

longitude

Character indicating which column stores longitude values.

latitude

Character indicating which column stores latitude values.

fill.color.low

Color to use for bottom of gradient.

fill.color.mid

Color to use for middle of gradient.

fill.color.high

Color to use for top of gradient.

space

Color space to use for gradient.

midpoint

Position of mid point of scale, defaults to 0.

path.color

Color to use for shapefile lines.

title

Title of plot.

title.size

Size of Title font.

title.hjust

Horizontal adjustment of Title position.

xlab

X-axis label.

ylab

Y-axis label.

barheight

Height of legend bar.

formatter

How the legend numbers should be formatted. Takes a function.

legend.position

Position of legend.

lhs

Left side of formula to use for facetting.

rhs

Right side of formula to use for facetting.

facet

The type of facetting, if any, to use.

wrap.nrow

The number of rows to to use when using facet_wrap.

wrap.ncol

The number of columns to to use when using facet_wrap.

scales

The scales to be employed when faceting.

gradient

1 means scale_colour_gradient, 2 means scale_colour_gradient2

Details

Takes a data.frame containing shapefile data and plots it along with some measure.

Will probably need to make changes for when plotting continuous data.

Value

A ggplot object.

Author(s)

Jared P. Lander

Examples

1
2
3
4
5
6
## Not run: 
nyc.income <- join(nyc.df, income2010, by="Key")
mana <- nyc.income[nyc.income$County == 61, ]
map.plot(mana, "Median.Income", formatter=multiple_format(extra=dollar, multiple="K"))

## End(Not run)

jaredlander/mapping documentation built on May 18, 2019, 3:46 p.m.