An open API service indexing awesome lists of open source software.

https://github.com/johncoene/echarts4r.maps

Maps for echarts4r
https://github.com/johncoene/echarts4r.maps

echarts rstats visualisation

Last synced: 14 days ago
JSON representation

Maps for echarts4r

Awesome Lists containing this project

README

        

---
output: github_document
---

[![Travis build status](https://travis-ci.org/JohnCoene/echarts4r.maps.svg?branch=master)](https://travis-ci.org/JohnCoene/echarts4r.maps)

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(echarts4r.maps)
```

# echarts4r.maps

Includes:

- 215 maps for [echarts4r](https://echarts4r.john-coene.com/).
- A dataset of the latitude and longitude of all cities on planet earth with greater than 1000 people.

## Installation

Install `echarts4r`.

```r
install.packages("echarts4r")
```

Then install `echarts4r.maps`

```r
install.packages("remotes")
remotes::install_github('JohnCoene/echarts4r.maps')
```

## Example

Use in echarts4r

```r
library(echarts4r)
library(echarts4r.maps)

df <- data.frame(
x = c(
"Rajasthan",
"Gujarat",
"Odisha"
),
y = 1:3
)

df %>%
e_charts(x) %>%
em_map("India") %>%
e_map(y, map = "India") %>%
e_visual_map(y)

# cities
library(dplyr)
data("cities")

cities %>%
filter(country == "US") %>%
mutate(val = runif(n(), 1, 2)) %>%
e_charts(lon) %>%
em_map("USA") %>%
e_geo(map = "USA") %>%
e_scatter(lat, val, coord_system = "geo", scale = NULL) %>%
e_visual_map(min = 1, max = 2)
```

## Bank

Another great resource for detailed maps is [here](https://code.highcharts.com/mapdata/) (use with `e_map_register`).

```{r}
em_bank()
```