This function creates two dataframes with the number of students, classes and students by class, aggregated at the province and municipality level
Group_nstud(
data = NULL,
Year = 2023,
check = TRUE,
verbose = TRUE,
check_registry = "Any",
InnerAreas = TRUE,
ord_InnerAreas = FALSE,
check_ggplot = FALSE,
missing_to_1 = FALSE,
input_Registry = NULL,
input_InnerAreas = NULL,
input_Prov_shp = NULL,
input_School2mun = NULL,
input_AdmUnNames = NULL,
autoAbort = FALSE,
...
)
An object of class list
including:
$Municipality_data
:
object of class tbl_df
, tbl
and data.frame
, the output dataframe detailed at the municipality level
$Province_data
: object of class 'tbl_df', 'tbl' and 'data.frame', the output dataframe detailad at the province level
Either an object of class list
, obtained as output of the Get_nstud
function,
or an object of class class tbl_df
, tbl
and data.frame
, obtained as output of the Util_nstud_wide
function,
if NULL
, the function will download it automatically but it will not be saved in the global environment. NULL
by default.
Numeric or character value. The reference school year, if either of the input_
arguments must be retrieved.
Available in the formats: 2022
, "2022/2023"
, "202223"
, "20222023"
. 2023
by default
Logical. If TRUE
, the function runs the test of the students number availability across all school included in the school registries (see Util_Check_nstud_availability
). TRUE
by default
Logical. If TRUE
, the user keeps track of the main underlying operations. TRUE
by default.
Character. If check == TRUE
, the school registries included in the input_School2mun
object (see Get_School2mun
) whose availability has to be checked. Either "Registry_from_buildings"
(buildings section), "Registry_from_registry"
(registry section), "Any"
or "Both"
. "Any"
by default.
Logical. If check == TRUE
, Whether it must be checked if municipalities belong to Inner areas or not. TRUE
by default.
Logical. If check == TRUE
and InnerAreas == TRUE
, 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.
Logical. If check == TRUE
, whether to display or not a static map of the availability of the students number by province; see also Util_Check_nstud_availability
. TRUE
by default.
Logical. Only needed if data
is not provided in wide format. Whether the number of classes should be imputed to 1 when it is missing; see Util_nstud_wide
. FALSE
by default.
Object of class tbl_df
, tbl
and data.frame
, obtained as output of the function Get_Registry
If check == TRUE
, the school registry (the properly said one, from the registry section).
If NULL
, it will be downloaded automatically, but not saved in the global environment.
NULL
by default
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 check == TRUE
and InnerAreas == TRUE
.
If NULL
, it will be downloaded automatically, but not saved in the global environment.
NULL
by default
Object of class sf
, tbl_df
, tbl
, data.frame
. The relevant shapefile of Italian municipalities, if both the check
and check_ggplot
options are chosen.
If NULL
it is downloaded automatically but not saved in the global environment. NULL
by default.
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. Needed only if `check == TRUE`.
If NULL
, it will be downloaded automatically, but not saved in the global environment. NULL
by default.
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 check == TRUE
and the argument input_School2mun
is NULL
.
If NULL
, it will be 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.
Additional arguments to the function Util_nstud_wide
if data
is not provided.
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.
Year <- 2023
nstud23_aggr <- Group_nstud(data = example_input_nstud23, Year = Year,
input_Registry = example_input_Registry23,
InnerAreas = FALSE,
input_School2mun = example_School2mun23)
summary(nstud23_aggr$Municipality_data[,c(46,47,48)])
summary(nstud23_aggr$Province_data[,c(44,45,46)])
Run the code above in your browser using DataLab