View source: R/Group_DB_MIUR.R
Group_DB_MIUR | R Documentation |
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
.
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,
...
)
data |
Object of class |
Year |
Numeric or Character. The reference school year, if either |
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 |
count_missing |
Logical. Whether the function should return two dataframes including the percentage of NAs in the |
verbose |
Logical. If |
track_deleted |
Logical. If |
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 |
input_InnerAreas |
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 |
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.
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;
all variables besides the first 5 (which identify the record) are numeric
$Province_data
: object of class 'tbl_df', 'tbl' and 'data.frame', the output dataframe detailad at the province level;
all variables besides the first 3 (which identify the record) are numeric
$Municipality_missing
(Only if count_missing == TRUE
); object of class tbl_df
, tbl
and data.frame
, the percentage of NAs in each variable at the municipality level.
$Province_missing
: (Only if count_missing == TRUE
); object of class 'tbl_df', 'tbl' and 'data.frame', the percentage of NAs in each variable at the province level.
$deleted
: character vector. The schools removed from the original dataframe for data quality reasons. This object is returned only if track_deleted == TRUE
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.