Util_DB_MIUR_num {SchoolDataIT} | R Documentation |
Convert the raw school buildings data to numeric or Boolean variables
Description
This function transforms the output variables of the Get_DB_MIUR
into Boolean or Numeric.
Additionally, it removes the columns with an excessive number of missing observations (20.000 by default), and if required it may also delete the rows including missing fields.
In this case, it is possible to keep track of the deleted rows.
Usage
Util_DB_MIUR_num(
data = NULL,
include_numerics = TRUE,
include_qualitatives = FALSE,
row_cutout = FALSE,
track_deleted = TRUE,
verbose = TRUE,
col_cut_thresh = 20000,
flag_outliers = TRUE,
autoAbort = FALSE,
...
)
Arguments
data |
Object of class |
include_numerics |
Logical. Whether to include strictly numeric variables alongside with Boolean ones. |
include_qualitatives |
Logical. Whether to include qualitative variables alongside with Boolean ones. |
row_cutout |
Logical. Whether to filter out rows including missing fields. |
track_deleted |
Logical. If |
verbose |
Logical. If |
col_cut_thresh |
Numeric. The threshold of missing values allowed for each variable.
If a variable as a higher number of missing observations, then it is cut out. |
flag_outliers |
Logical. Whether to assign NA to outliers in numeric variables. |
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
The outliers to be set to NA
if flag_outliers
is active are defined as follows: School area or free area surface of less than 50 squared meters,
building volume of less than 150 cubic meters, 0 floors in the building.
Value
If track_deleted == TRUE
, An object of class list
including two objects:
-
$data
: object of classtbl_df
,tbl
anddata.frame
, the output dataframe. -
$deleted
: object of classtbl_df
,tbl
anddata.frame
. The school IDs of the deleted units.
If track_deleted == FALSE
, the output is only the first element of the list.
Examples
library(magrittr)
DB23_MIUR_num <- example_input_DB23_MIUR %>% Util_DB_MIUR_num(track_deleted = FALSE)
DB23_MIUR_num[, -c(1,4,6,8,9,10)]
summary(DB23_MIUR_num)