This function displays either a static or interactive map of the Invalsi scores, either at the municipality or province level. 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.
Map_Invalsi(
data = NULL,
Year = 2023,
subj_toplot = "ITA",
grade = 8,
level = "LAU",
main = "",
main_pos = "top",
region_code = c(1:20),
plot = "mapview",
pal = "viridis",
WLE = FALSE,
col_rev = FALSE,
popup_height = 200,
only_observed = FALSE,
verbose = TRUE,
input_shp = NULL,
autoAbort = FALSE
)
If plot == "mapview"
, an object of class mapview
. Otherwise, if plot == "ggplot"
, an object of class gg
and ggplot
.
Object of class tbl_df
, tbl
and data.frame
.
The raw Invalsi survey data that has to be filtered, obtained as output of the Get_Invalsi_IS
function.
If NULL
, it will be downloaded automatically, but not saved in the global environment.
NULL
by default
Numeric or character value. Reference school year for the data (last available is 2022/23).
Available in the formats: 2022
, "2021/2022"
, 202122
, 20212022
. 2022
by default
Character. The school subject to display in the map,
The school subject to include, one among:
"Englis_listening"
/"ELI"
, "English_reading"
/"ERE"
, "Italian"
/"ITA"
and "Mathematics"
/"MAT"
. "ITA"
(Italian) by default.
Numeric. The school grade to chose. Either 2
(2nd year of primary school), 5
(last year of primary school), 8
(last year of middle shcool), 10
(2nd year of high school) or 13
(last year of school). 8
by default
Character. The level of aggregation of Invalsi census data. Either "NUTS-3"
, "Province"
, "LAU"
, "Municipality"
.
If an input dataframe is provided, please select the same level of aggregation.
"LAU"
by default
Character. A customary title to the map. If NULL
, the title will mention: subject, year and school grade. Empty by default.
Character.Where the header should be placed if the ggplot
mode is chosen.
The header is located on the top if "top"
is given as input, and above the legend scale otherwise. "top"
by default.
Numeric. The NUTS-2 codes of the units that must be displayed.
If the level is set to "LAU"
, choosing a limited number of regions is recommended.
By default, c(1,3,5:20)
, i.e. all Italian regions except the provinces of Aosta, Trento and Bozen which have data availability issues.
Character. The type of map to display; either "mapview"
for interactive maps, or "ggplot"
for static maps. "mapview"
by default.
Character. The palette to use if the "mapview"
mode is chose. "viridis"
by default.
Logical. Whether the variable to chose should be the average WLE score rather that the percentage of sufficient tests, if both are available. FALSE
by default
Logical. Whether the scale of the colour palette should be reverted or not, if the mapview
mode is chosen. FALSE
by default
Numeric. The height of the popup table in terms of pixels if the "mapview"
mode is chosen. 200
by default.
Logical. Whether to remove unobserved areas from the plot. FALSE
by default.
Logical. If TRUE
, the user keeps track of the main underlying operations. TRUE
by default.
Object of class sf
, tbl_df
, tbl
, data.frame
. The relevant shapefiles of Italian administrative boudaries,
at the selected level of detail (LAU or NUTS-3). If NULL
, it is downloaded automatically but not saved in the global environment. NULL
by default.
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. FALSE
by default.
Map_Invalsi(subj = "Italian", grade = 13, level = "NUTS-3", Year = 2023, WLE = FALSE,
data = example_Invalsi23_prov, input_shp = example_Prov22_shp, plot = "ggplot")
Map_Invalsi(subj = "Italian", grade = 5, level = "NUTS-3", Year = 2023, WLE = TRUE,
data = example_Invalsi23_prov, input_shp = example_Prov22_shp, plot = "ggplot")
Run the code above in your browser using DataLab