emap_coords: Add map coordinates

Description Usage Arguments Examples

View source: R/add.R

Description

Add coordinates to map.

Usage

1
2
3
emap_coords(p, lon, lat)

emap_coords_(p, lon, lat)

Arguments

p

an echart object

lon, lat

coordinates to plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
coords <- data.frame(city = c("London", "New York", "Beijing", "Sydney"),
  lon = c(-0.1167218, -73.98002, 116.3883, 151.18518),
  lat = c(51.49999, 40.74998, 39.92889, -33.92001))

edges <- data.frame(source = c("Beijing", "Beijing", "New York"),
  target = c("Sydney", "London", "London"))

coords %>%
  echart(city) %>%
  emap() %>%
  emap_coords(lon, lat) %>%
  emap_lines(edges, source, target)

JohnCoene/echarts documentation built on May 4, 2018, 8:04 a.m.