inst/doc/e-admin1-choropleths.R

## -----------------------------------------------------------------------------
library(choroplethrAdmin1)
?admin1.map

## ----message=FALSE------------------------------------------------------------
library(choroplethr)
?df_japan_census
data(df_japan_census)
head(df_japan_census)

## -----------------------------------------------------------------------------
head(get_admin1_countries())

## -----------------------------------------------------------------------------
head(get_admin1_regions("japan"))

## -----------------------------------------------------------------------------
admin1_map("japan")

## -----------------------------------------------------------------------------
df_japan_census$value = df_japan_census$pop_2010

## -----------------------------------------------------------------------------
library(choroplethr)
?admin1_choropleth
admin1_choropleth(country.name = "japan", 
                  df           = df_japan_census, 
                  title        = "2010 Japan Population Estimates", 
                  legend       = "Population", 
                  num_colors   = 1)

## -----------------------------------------------------------------------------
kansai = c("mie", "nara", "wakayama", "kyoto", "osaka", "hyogo", "shiga")
admin1_choropleth(country.name = "japan", 
                  df           = df_japan_census, 
                  title        = "2010 Japan Population Estimates - Kansai Region", 
                  legend       = "Population", 
                  num_colors   = 1, 
                  zoom         = kansai)

Try the choroplethr package in your browser

Any scripts or data that you put into this service are public.

choroplethr documentation built on July 9, 2023, 5:35 p.m.