Merges data_frame obtained from Eurostat with get_eurostat with geospatial data preprocessed either using ggplot2::fortify into a data_frame or a regular SpatialPolygonDataFrame. The resulting data_frame can be plotted using ggplot2 and SpatialPolygonDataFrame using sp::spplot.

merge_eurostat_geodata(data, geocolumn = "geo", resolution = "60",
  output_class = "df", all_regions = FALSE, cache = TRUE,
  update_cache = FALSE, cache_dir = NULL)

Arguments

data

A data_frame including a character vector that consists of values following current NUTS classification

geocolumn

A string. Name of the column with NUTS information (geo in data_frames fetched using get_eurostat)

resolution

Resolution of the geospatial data. One of "60" (1:60million), "20" (1:20million), "10" (1:10million), "01" (1:1million),

output_class

A string. Class of object returned, either df (data_frame) or spdf (SpatialPolygonDataFrame)

all_regions

Logical. To include all the regions from spatial data or only the ones included in the fetched Eurostat attribute data

cache

cache. Logical.

update_cache

Update cache. Logical.

cache_dir

Cache directory.

Value

a data_frame or SpatialPolygonDataFrame.

Examples

# NOT RUN { lp <- get_eurostat("nama_aux_lp") lpl <- merge_eurostat_geodata(lp, geocolumn="geo", resolution=60, output_class="df", all_regions=FALSE) str(lpl) # }