Util_Check_nstud_availability {SchoolDataIT}R Documentation

Check how many schools in the school registries are included in the students count dataframe

Description

This function checks for which schools listed in the two registries (the buildings registry and the properly said schools registry) the count of students is available. The first registry is referred to as as Registry_from_buildings and the second one as Registry_from_registry.

Usage

Util_Check_nstud_availability(
  data,
  Year,
  cutout = c("IC", "IS", "NR"),
  verbose = TRUE,
  ggplot = TRUE,
  toplot_registry = "Any",
  InnerAreas = TRUE,
  ord_InnerAreas = FALSE,
  input_Registry = NULL,
  input_InnerAreas = NULL,
  input_Prov_shp = NULL,
  input_AdmUnNames = NULL,
  input_School2mun = NULL,
  autoAbort = FALSE
)

Arguments

data

Object of class tbl_df, tbl and data.frame, obtained as output of the Util_nstud_wide function

Year

Numeric or character value. Reference school year. Available in the formats: 2023, "2022/2023", 202223, 20222023.

cutout

Character. The types of schools not to be taken into account (because not relevant or because they are out of scope in the students number section). By default c("IC", "IS", "NR") , i.e. the check does not regard comprehensive institutes, superior institutes, and all the schools that cannot be classified either as primary, middle or high schools.

verbose

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

ggplot

Logical. If TRUE, the function displays a static map of the availability of the students number by province (but it does not save the ggplot object into the global environment). TRUE by default.

toplot_registry

Character. If the ggplot option is chosen, the students number availability of which registry must be plotted; either "Registry_from_buildings", "Registry_from_registry", "Any" or "Both". "Any" by default.

InnerAreas

Logical. Whether it must be checked if municipalities belong to inner areas or not. TRUE by default.

ord_InnerAreas

Logical. Whether the inner areas classification should be treated as an ordinal variable rather than as a categorical one (see Get_InnerAreas for the classification). FALSE by default.

input_Registry

Object of class tbl_df, tbl and data.frame, obtained as output of the function Get_Registry The school registry from the registry section. If NULL, it will be downloaded automatically, but not saved in the global environment. NULL by default

input_InnerAreas

Object of class tbl_df, tbl and data.frame. The classification of peripheral municipalities, obtained as output of the Get_InnerAreas function. Needed only if the InnerAreas option is chosen. If NULL, it will be downloaded automatically, but not saved in the global environment. NULL by default

input_Prov_shp

Object of class sf, tbl_df, tbl, data.frame. The relevant shapefile of Italian municipalities, if the ggplot option is chosen. If NULL it is downloaded automatically but not saved in the global environment. NULL by default.

input_AdmUnNames

Object of class tbl_df, tbl and data.frame, obtained as output of the function Get_AdmUnNames The ISTAT file including all the codes and the names of the administrative units for the year in scope. Only needed if the argument input_School2mun is NULL and has to be computed. If NULL, it will be downloaded automatically, but not saved in the global environment. NULL by default.

input_School2mun

Object of class list with elements of class tbl_df, tbl and data.frame, obtained as output of the function Get_School2mun. The mapping from school codes to municipality (and province) codes. If NULL, it will be 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

An object of class list including two elements:

Both the elements are objects of class list including four elements:

Source

Buildings Registry; Schools Registry

Examples


nstud23 <- Util_nstud_wide(example_input_nstud23, verbose = FALSE)

Util_Check_nstud_availability(nstud23, Year = 2023,
  input_Registry = example_input_Registry23, InnerAreas = FALSE,
  input_School2mun = example_School2mun23, input_Prov_shp = example_Prov22_shp)






[Package SchoolDataIT version 0.2.0 Index]