knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(gior)

gior provides a very simple, straightforward API; initialise your globe with gior, then add select your data with g_data. For testing purposes the package comes with sample data.

data("country_data")

knitr::kable(head(country_data)) # sample data

Use ISO 3166 Alpha-2 codes, i.e.: United States of America = US.

country_data %>% # pipe the data
  gior() %>% # initialise
  g_data(from, to, value) # select columns

Then simply customise the appearance with:

Or use one of the 13 built-in styles with g_style, see ?g_style for the full list. Note that you can also change the country initally selected.

country_data %>% 
  gior(init.country = "ET") %>% # Ethiopia selected
  g_data(from, to, value) %>% 
  g_style("sunset")


JohnCoene/gior documentation built on March 6, 2020, 1:07 a.m.