Learn R Programming

leafdown

The leafdown package provides drilldown functionality for leaflet choropleths in R Shiny apps.

Installation

You can install the released version of leafdown from CRAN with:

install.packages("leafdown")

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("hoga-it/leafdown")

Documentation

You can find the documentation here.

Features

  • Adds drilldown functionality for leaflet choropleths maps.
  • Allows the selection of regions/shapes.
  • Easy to use and well-integrated into syntax of the leaflet R package.
  • Allows communication of the map with other shiny elements (e.g. graphs).
  • Computationally efficient as drilldown is only executed for selected regions of interest.

Showcase - Election Map

To showcase the features of the leafdown package we have created a demo app.

This app shows the 2016 us presidential election results as well as some demographic information. Click here for the full demo app and here for the documentation.

Showcase - healthdown

The healthdown app allows interactive comparison of various health factors at the U.S. state and county level. It was honored as “Runners up” in the Shiny Contest 2021.

Link to healthdown: https://hoga.shinyapps.io/healthdown/

Code: https://github.com/hoga-it/healthdown

Showcase - Weather stations

This app allows interactive comparison of weather station measurements between states, counties and individual stations. It was primarily developed for Andreas’ talk at the rstudio::conf(2022), where he demonstrated the capabilities of the leafdown package.

Link to the app: https://hoga.shinyapps.io/leafdown_rstudio_conf_2022/

Code: https://github.com/andreash0/leafdown_rstudio_conf_2022

Copy Link

Version

Install

install.packages('leafdown')

Monthly Downloads

205

Version

1.2.0

License

GPL-3

Maintainer

Andreas Hofheinz

Last Published

September 19th, 2022

Functions in leafdown (1.2.0)

assert_join_map_levels_by

Check whether the given join_map_levels_by is valid
Leafdown

Leafdown R6 Class
us_election_counties

Results of the 2016 US Presidential Election - County Level
us_election_states

Results of the 2016 US Presidential Election - State Level
assert_spdf_list

Check whether the given spdf_list is a valid spdf_list and has all the required params.
gdp_2014_admin_districts

GPD for administrative districts of Germany for 2014.
check_draw_ellipsis

Checks for undesired arguments in ellipsis in $draw_leafdown method
gdp_2014_federal_states

GPD for federal states of Germany for 2014.