Map_Invalsi {SchoolDataIT}R Documentation

Display a map of Invalsi scores

Description

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:

Usage

Map_Invalsi(
  Year = 2023,
  data = NULL,
  subj_toplot = "ITA",
  grade = 8,
  level = "LAU",
  main = "",
  main_pos = "top",
  region_code = c(1:20),
  plot = "mapview",
  pal = "Blues",
  WLE = FALSE,
  col_rev = FALSE,
  popup_height = 200,
  verbose = TRUE,
  input_shp = NULL,
  autoAbort = FALSE
)

Arguments

Year

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

data

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

subj_toplot

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.

grade

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

level

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

main

Character. A customary title to the map. If NULL, the title will mention: subject, year and school grade. Empty by default.

main_pos

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.

region_code

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.

plot

Character. The type of map to display; either "mapview" for interactive maps, or "ggplot" for static maps. "mapview" by default.

pal

Character. The palette to use if the "mapview" mode is chose. "Blues" by default.

WLE

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

col_rev

Logical. Whether the scale of the colour palette should be reverted or not, if the mapview mode is chosen. FALSE by default

popup_height

Numeric. The height of the popup table in terms of pixels if the "mapview" mode is chosen. 200 by default.

verbose

Logical. If TRUE, the user keeps track of the main underlying operations. TRUE by default.

input_shp

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.

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. FALSE by default.

Value

If plot == "mapview", an object of class mapview. Otherwise, if plot == "ggplot", an object of class gg and ggplot.

Examples





 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")






[Package SchoolDataIT version 0.2.0 Index]