Description Usage Arguments Examples
Add arcs by name of country of state.
1 | add_arcs_name(p, origin, destination, ...)
|
p |
a datamaps object. |
origin, destination |
edges. |
... |
any other arguments to use as options. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data <- data.frame(origin = c("USA", "FRA", "CHN", "RUS", "COG", "DZA"),
target = c("FRA", "RUS", "BEL", "CAF", "VEN", "SWZ"),
greatArc = rep(c(TRUE, FALSE), 3),
arcSharpness = 2)
data %>%
datamaps() %>%
add_arcs_name(origin, target, greatArc, arcSharpness)
# US states
states <- data.frame(origin = c("AR", "NY", "CA", "IL", "CO", "MT",
"TX", "WA", "TN", "MT"),
target = c("OR", "SD", "WI", "TX", "LA", "AZ", "FL", "MI", "HI",
"OK"),
strokeWidth = runif(10, 1, 9),
strokeColor = colorRampPalette(c("red", "blue"))(10))
states %>%
datamaps(scope = "USA", default = "lightgray") %>%
add_arcs_name(origin, target, strokeWidth, strokeColor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.