plot_polygon: Plot polygon on map

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot_polygon.R

Description

Adds a polygon to an existing ggmap object.

Usage

1
plot_polygon(polygon, colour = "blue", plot = "", zoom = -1)

Arguments

polygon

list. A list with the column lon (numeric) and lat (numeric).

colour

character. Colour of the line.

plot

ggmap. An existing map / plot where the tracks are added. If no plot is provided a Google map will be downloaded.

zoom

numeric. Zoom factor of the map. See ggmap::get_googlemap.

Value

A ggmap object.

Author(s)

Benjamin Ziepert. Please send feedback to: feedback-psyosphere@analyse-gps.com.

See Also

plot_map, plot_line, plot_tracks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: \dontrun{
lon <- c(6.849975, 6.849627, 6.850001, 6.850350, 6.849975)
lat <- c(52.241745, 52.241100, 52.241004, 52.241649, 52.241745)
polygon <- data.frame(lon, lat)
remove(lon, lat)

plot <- plot_polygon(polygon)
plot
}
## End(Not run)

psyosphere documentation built on July 2, 2020, 12:08 a.m.