Frequently Asked Questions
Indicator Coverage
Q: How many indicators does localintel support?
n <- indicator_count()
cat(n$indicators, "indicators across", n$domains, "domains\n")
print(n$by_domain)The package ships with curated registries for 14 domains. You can
also use process_eurostat() to process any
Eurostat dataset not in the registry.
Q: My dataset isn’t in the registry. Can I still use localintel?
Absolutely. The core pipeline (fetch → process → cascade → visualize → export) works with any Eurostat dataset. Use the generic workflow:
library(dplyr)
raw <- get_nuts_level_robust("your_eurostat_code", level = 2, years = 2010:2024)
processed <- process_eurostat(raw,
filters = list(unit = "PC", sex = "T"),
out_col = "my_indicator")
cascaded <- cascade_to_nuts2(
processed, vars = "my_indicator", years = 2010:2024)Data Fetching
Q: The Eurostat API is returning empty data or timing out.
The Eurostat bulk download API can be intermittent. localintel has built-in mitigation:
data <- get_nuts_level_robust("nama_10r_2gdp", level = 2, years = 2010:2024)
data <- get_nuts_level_safe("nama_10r_2gdp", level = 2, years = 2010:2024)If problems persist, clear the Eurostat cache:
eurostat::clean_eurostat_cache()Q: How can I speed up repeated runs?
Save fetched data locally:
data_list <- fetch_eurostat_batch(economy_codes(), level = 2, years = 2010:2024)
export_to_rds(data_list, "data/raw_economy.rds")
# Later
data_list <- readRDS("data/raw_economy.rds")Cascading
Q: How does cascading decide which level to use?
Priority order: NUTS 2 > NUTS 1 > NUTS 0. The
src_<variable>_level column tracks which level each
value came from.
Q: Should I use cascade_to_nuts2() or
cascade_to_nuts2_and_compute()?
Use cascade_to_nuts2() for any domain — it is fully
generic. Use cascade_to_nuts2_and_compute() only when you
need health-specific derived indicators (DA and rLOS).
Visualization
Q: Why do some countries appear as a single block on the map?
If a country only reports at NUTS 0, the map uses the national boundary. This is by design — the “best available resolution” approach.
Q: Can I use ggplot2 instead of tmap?
Yes. Build the sf object with build_display_sf(), then
plot with ggplot2:
library(ggplot2)
sf_data <- build_display_sf(cascaded, geopolys, var = "gdp", years = 2023:2023)
ggplot(sf_data) +
geom_sf(aes(fill = value), color = "white", size = 0.1) +
scale_fill_viridis_c() +
theme_minimal()General
Q: Which EU countries are included?
eu27_codes()
filtered <- keep_eu27(data, extras = c("NO", "CH"))