check_data: Make tests on a dataset (dataframe and tibbles)

View source: R/check_data.R

check_dataR Documentation

Make tests on a dataset (dataframe and tibbles)

Description

A dataset can't have qualitative variables, neither vector of strings nor missing values for computing convergence measures. A time variable should also be present, and if the name is passed then a check on the time order is performed. The object returned states if the dataset is ready for calculations, and if it is not, the error component states why checking failed.

Usage

check_data(tavDes, timeName = NA)

Arguments

tavDes

the dataframe under examination

timeName

a string with the name of the time variable, optional

Value

an object stating if errors are present

References

https://unimi2013-my.sharepoint.com/:u:/g/personal/federico_stefanini_unimi_it/EW0cVSIgbtZAvLPNbqcxdX8Bfn5VGSRHfAH88hQwc_RIEQ?e=MgtSZu

Examples


# Example 1
# Tibble dataset with missing values:
require(tibble)
myTB1  <- tibble::tribble(
~time, ~veval,
1988,   1201,
1989,    NA,
1990,   998,
1991,    NA
)
# Check dataset:
check_data(myTB1)

# Example 2
# Dataset with no missing values, no qualitative variables, and variable time present:
myTB2  <- tibble::tribble(
~time, ~veval,
1988,   1201,
1989,    450,
1990,   998,
1991,   675
)
check_data(myTB2)

# Check the "emp_20_64_MS" Eurofound dataset:
data(emp_20_64_MS)
check_data(emp_20_64_MS, timeName="time")


convergEU documentation built on March 7, 2023, 7:22 p.m.