Learn R Programming

datamaps (version 0.0.3)

add_arcs: Add arcs

Description

Add arcs by coordinates.

Usage

add_arcs(p, origin.lon, origin.lat, destination.lon, destination.lat, ...)

Arguments

p

a datamaps object.

origin.lon, origin.lat

origin coordinates.

destination.lon, destination.lat

destination coordinates.

...

any other arguments to use as options.

Examples

Run this code
# NOT RUN {
states <- data.frame(ori.lon = c(-97.03720, -87.90446),
    ori.lat = c(32.89595, 41.97960),
    des.lon = c(-106.60919, -97.66987),
    des.lat = c(35.04022, 30.19453),
    strokeColor = c("blue", "red"),
    arcSharpness = c(2, 1))

states %>%
    datamaps(scope = "USA", default = "lightgray") %>%
    add_arcs(ori.lon, ori.lat, des.lon, des.lat, strokeColor)

# }

Run the code above in your browser using DataLab