Group_nstud {SchoolDataIT} | R Documentation |
Aggregate the students number data by class at the municipality and province level
Description
This function creates two dataframes with the number of students, classes and students by class, aggregated at the province and municipality level
Usage
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,
...
)
Arguments
data |
Either an object of class |
Year |
Numeric or character value. The reference school year, if either of the |
check |
Logical. If |
verbose |
Logical. If |
check_registry |
Character. If |
InnerAreas |
Logical. If |
ord_InnerAreas |
Logical. If |
check_ggplot |
Logical. If |
missing_to_1 |
Logical. Only needed if |
input_Registry |
Object of class |
input_InnerAreas |
Object of class |
input_Prov_shp |
Object of class |
input_School2mun |
Object of class |
input_AdmUnNames |
Object of class |
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. |
... |
Additional arguments to the function |
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.
Value
An object of class list
including:
-
$Municipality_data
: object of classtbl_df
,tbl
anddata.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
Examples
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)])