Map_School_Buildings {SchoolDataIT} | R Documentation |
Display data fom the school buildings database
Description
This function displays a map of the data downloaded trough the Get_DB_MIUR
function.
It supports two kinds of map:
Interactive map (default option), which allows the user to visualize all the data in scope through the interactive popup, and
Static map (ggplot), which can be easily exported in
.pdf
objects.
Usage
Map_School_Buildings(
data = NULL,
field,
order = NULL,
level = "LAU",
region_code = c(1:20),
plot = "mapview",
pal = "Blues",
col_rev = FALSE,
popup_height = 200,
main_pos = "top",
main = "",
verbose = TRUE,
input_shp = NULL,
autoAbort = FALSE,
...
)
Arguments
data |
Object of class |
field |
Character. The variable to display in the map. |
order |
Character. The school order. Either |
level |
Character. The administrative level of detailed at which the target variable must be displayed.
Either |
region_code |
Numeric. The NUTS-2 codes of the units that must be displayed.
If the level is set to |
plot |
Character. The type of map to display; either |
pal |
Character. The palette to use if the |
col_rev |
Logical. Whether the scale of the colour palette should be reverted or not, if the |
popup_height |
Numeric. The height of the popup table in terms of pixels if the |
main_pos |
Character. Where the header should be placed if the |
main |
Character. The customary title to display in the |
verbose |
Logical. If |
input_shp |
Object of class |
autoAbort |
Logical. In case any data must be retrieved, whether to automatically abort the operation and return NULL in case of missing internet connection or server response errors. |
... |
If |
Value
If plot == "mapview"
, an object of class mapview
. Otherwise, if plot == "ggplot"
, an object of class gg
and ggplot
.
Examples
library(magrittr)
DB23_MIUR <- example_input_DB23_MIUR %>%
Util_DB_MIUR_num(track.deleted = FALSE) %>%
Group_DB_MIUR(InnerAreas = FALSE, count_missing = FALSE)
DB23_MIUR %>% Map_School_Buildings(field = "School_bus",
order = "Primary",level = "NUTS-3", plot = "ggplot",
input_shp = example_Prov22_shp)
DB23_MIUR %>% Map_School_Buildings(field = "Railway_transport",
order = "High",level = "NUTS-3", plot = "ggplot",
input_shp = example_Prov22_shp)
DB23_MIUR %>% Map_School_Buildings(field = "Context_without_disturbances",
order = "Middle",level = "NUTS-3", plot = "ggplot",
input_shp = example_Prov22_shp, col_rev = TRUE)