ggplot2 mapping

Share:

Description

ggplot2 mapping

Usage

1
2
map_ggplot(x, map = "world", point_color = "#86161f", color = NULL,
  size = 3, lon = "longitude", lat = "latitude", ...)

Arguments

x

The data. An object of class occdat, occdatind, gbif, SpatialPoints, SpatialPointsDataFrame, or data.frame. The package spocc needed for the first two, and rgbif needed for the third. When data.frame input, any number of columns allowed, but with at least the following: name (the taxonomic name), latitude (in dec. deg.), longitude (in dec. deg.)

map

(character) One of world, world2, state, usa, county, france, italy, or nz

point_color

Default color of your points. Deprecated, use color

color

Default color of your points.

size

point size, Default: 3

lon, lat

(character) Longitude and latitude variable names. Ignored unless data.frame input to x parameter. We attempt to guess, but if nothing close, we stop. Default: longitude and latitude

...

Ignored

Value

A ggplot2 map, of class gg/ggplot

Examples

1
2
3
4
5
6
7
# map spocc output, here using a built in object
data(occdat_eg1)
map_ggplot(occdat_eg1)

# map rgbif output, here using a built in object
data(gbif_eg1)
map_ggplot(gbif_eg1)