Group_DB_MIUR {SchoolDataIT}R Documentation

Aggregate the database of Italian public schools buildings at the municipality and province level

Description

This function transforms the output of the Util_DB_MIUR_num function (which is detailed at the level of single school buildings) at the municipality/LAU and province/NUTS-3 level. It also allows the user to classify the grade of centrality of municipalities through the variable Inner_area.

Usage

Group_DB_MIUR(
  data = NULL,
  Year = 2023,
  count_units = TRUE,
  countname = "nbuildings",
  count_missing = TRUE,
  verbose = TRUE,
  track_deleted = TRUE,
  InnerAreas = TRUE,
  ord_InnerAreas = FALSE,
  input_InnerAreas = NULL,
  autoAbort = FALSE,
  ...
)

Arguments

data

Object of class tbl_df, tbl and data.frame. The database of school buildings, preferably already converted to numeric, obtained via Util_DB_MIUR_num

Year

Numeric or Character. The reference school year, if either data or input_InnerAreas must be retrieved. Available in the formats: 2023, "2022/2023", 202223, 20222023. Important: use the same Year argument used to retrieve the input school buildings data if they are provided as input. 2023 by default

count_units

Logical. Whether the rows to aggregate at each level must be counted or not. True by default.

countname

character. The name of the variable indicating the number of schools included in each municipality of province, if the argument 'count' is TRUE. "nbuildings" by default.

count_missing

Logical. Whether the function should return two dataframes including the percentage of NAs in the data object at the territorial level. TRUE by default

verbose

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

track_deleted

Logical. If TRUE, the function returns the IDs of schools not included. TRUE by default.

InnerAreas

Logical. Whether an indicator of the percentage of schools belonging to peripheral (Inner) areas mus be included or not.

ord_InnerAreas

Logical. Whether the Inner areas classification should be treated as an ordinal variable rather than as a binary one (see Get_InnerAreas for the classification). Please notice than the function creates a column for each class, and if this database must be used in a statistical model, one of the 6 resulting columns must be dropped. False by default.

input_InnerAreas

Object of class tbl_df, tbl and data.frame. The classification of peripheral municipalities, needed only if InnerAreas == TRUE, obtained as output of the Get_InnerAreas function. 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.

...

Additional arguments to the function Util_DB_MIUR_num in case no data are provided or data.

Details

Numerical variables are summarised by the mean; Boolean variables are summarised by the mean as well, thus they become frequency indicators. Qualitative values, if included, are summarised by the mode. Summary measures do not include NAs. The output dataframes are also detailed at the school order level (i.e. Primary, Midde, High school, or different orders). This means that rows are unique combinations of territorial unities and school order.

Value

An object of class list including:

Examples



library(magrittr)
DB23_MIUR <- example_input_DB23_MIUR %>% Util_DB_MIUR_num(verbose = FALSE) %>%
    Group_DB_MIUR(InnerAreas = FALSE)



DB23_MIUR$Municipality_data[, -c(1,2,4)]
summary(DB23_MIUR$Municipality_data)

DB23_MIUR$Province_data[, -c(1,3)]
summary(DB23_MIUR$Province_data)






[Package SchoolDataIT version 0.1.1 Index]