Title: | Europe SpatialPolygonsDataFrame Builder |
---|---|
Description: | Build custom Europe SpatialPolygonsDataFrame, if you don't know what is a SpatialPolygonsDataFrame see SpatialPolygons() in 'sp', by example for mapLayout() in 'antaresViz'. Antares is a powerful software developed by RTE to simulate and study electric power systems (more information about 'Antares' here: <https://antares-simulator.org/>). |
Authors: | Tatiana Vargas [aut, cre], Jalal-Edine ZAWAM [aut], Benoit Thieurmel [aut], RTE [cph] |
Maintainer: | Tatiana Vargas <[email protected]> |
License: | GPL (>= 2) | file LICENSE |
Version: | 0.5.1.9000 |
Built: | 2025-02-02 06:29:07 UTC |
Source: | https://github.com/rte-antares-rpackage/spmaps |
SpatialPolygonsDataFrame
)This function builds a custom Europe map and return a SpatialPolygonsDataFrame
.
The output can be use by example in mapLayout with the map
argument.
getEuropeReferenceTable() getEuropeCountries(mergeCountry = TRUE) getEuropeStates() getSpMaps(countries = "all", states = NULL, mergeCountry = TRUE)
getEuropeReferenceTable() getEuropeCountries(mergeCountry = TRUE) getEuropeStates() getSpMaps(countries = "all", states = NULL, mergeCountry = TRUE)
mergeCountry |
|
countries |
|
states |
|
SpatialPolygonsDataFrame
# default map : Europe without states europe_cty <- getSpMaps() plot(europe_cty) # subset on some countries ref_table <- getEuropeReferenceTable() italy_spain_fra <- getSpMaps(countries = c("FRA", "ITA", "ESP")) plot(italy_spain_fra) ## Not run: italy_spain_fra_states <- getSpMaps(countries = NULL, states = c("FRA", "ITA", "ESP")) plot(italy_spain_fra_states) # combine countries and states combine_map <- getSpMaps(countries = c("ITA", "ESP"), states = "FRA") plot(combine_map) # build your custom map : you can use directly data # to subset the area you really want europe_states <- getEuropeStates() europe_countries <- getEuropeCountries() # for example, have a look to GBR states map summary(europe_states) gbr_states_districts <- europe_states[ europe_states$code %in% "GBR" & europe_states$type %in% "Administrative County",] plot(gbr_states_districts) # combine with another map : you just have to have the same columns... # getSpMaps only return "name" and "code" column custom_states <- rbind( getSpMaps(countries = NULL, states = "FRA"), gbr_states_districts[, c("name", "code"), drop = FALSE]) plot(custom_states) ## End(Not run)
# default map : Europe without states europe_cty <- getSpMaps() plot(europe_cty) # subset on some countries ref_table <- getEuropeReferenceTable() italy_spain_fra <- getSpMaps(countries = c("FRA", "ITA", "ESP")) plot(italy_spain_fra) ## Not run: italy_spain_fra_states <- getSpMaps(countries = NULL, states = c("FRA", "ITA", "ESP")) plot(italy_spain_fra_states) # combine countries and states combine_map <- getSpMaps(countries = c("ITA", "ESP"), states = "FRA") plot(combine_map) # build your custom map : you can use directly data # to subset the area you really want europe_states <- getEuropeStates() europe_countries <- getEuropeCountries() # for example, have a look to GBR states map summary(europe_states) gbr_states_districts <- europe_states[ europe_states$code %in% "GBR" & europe_states$type %in% "Administrative County",] plot(gbr_states_districts) # combine with another map : you just have to have the same columns... # getSpMaps only return "name" and "code" column custom_states <- rbind( getSpMaps(countries = NULL, states = "FRA"), gbr_states_districts[, c("name", "code"), drop = FALSE]) plot(custom_states) ## End(Not run)