Learn R Programming

convergEU (version 0.7.3.2)

check_data: 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)

Value

an object stating if errors are present

Arguments

tavDes

the dataframe under examination

timeName

a string with the name of the time variable, optional

References

https://www.eurofound.europa.eu/system/files/2022-04/introduction-to-the-convergeu-package-0.6.4-tutorial-v2-apr2022.pdf

Examples

Run this code

# 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")

Run the code above in your browser using DataLab