Skip to contents

nutsr provides functions to visualize spatial data. This article showcases currently implemented methods as well as some prototypes for future visualization.

Maps

nuts_map() creates maps of regions using the leaflet package. The input dataset should contain region codes that are compatible with nutsr.

iso5_pop() %>% 
  filter(substr(iso, 1, 1) == 9) %>% 
  nuts_map(overlay_nuts2 = FALSE)

Drilldown

nuts_drilldown() allows you to create graphs similar to https://www.highcharts.com/demo/column-drilldown based on iso5 data. Regions can be expanded by clicking on the bars. It is planned to also add support for iso3 data in the future.

nuts_drilldown(iso5_pop(), title = "Population of ${name}", 
               value_label = "population")

To use this function with STATcubeR datasets, it is easiest to use the raw parameter of the $tabulate() method.

x <- STATcubeR::od_table('OGD_gem_basis_quer1_GemHH_BQ_1')
y <- x$tabulate("Commune", "Ordinary expenditures", raw = TRUE)
y <- y[y[[1]] %in% iso5()$code, ]
nuts_drilldown(y, title = "ordinary expenditures in ${name}",
               value_label = "expenditures")

Scatter

readRDS('graphs/by_age.rds')

Timeseries

readRDS('graphs/ts_to_bar.rds')

Packed Bubble

readRDS('graphs/packedbubble.rds')

Dependency Wheel

Migration data from Statistics Austria.

readRDS('graphs/dependencywheel.rds')

Bubble chart

readRDS('graphs/bubble.rds')

Voilin

readRDS('graphs/violin.rds')

Age Distribution

readRDS('graphs/dist_nuts2.rds')

Variwide

# highchartszero() doesn't work with rmarkdown?
# readRDS('graphs/variwide.rds')

Treemap

readRDS('graphs/treemap.rds')

Dumbbell

readRDS('graphs/dumbbell.rds')