Learn R Programming

DCEM (version 1.0.0)

validate_data: validate_data: Part of DCEM package.

Description

Implements sanity check for the input data. This function is for internal use and is called by the dcem_train.

Usage

validate_data(columns, numcols)

Arguments

columns

(string): A comma separated list of columns that needs to be removed from the dataset. Default: ''

numcols

(numeric): Number of columns in the dataset.

Value

boolean: TRUE if the columns exists otherwise FALSE.

Details

An example would be to check if the column to be removed exist or not? trim_data internally calls this function before removing the column(s).

References

Using data to build a better EM: EM* for big data.

Hasan Kurban, Mark Jenne, Mehmet M. Dalkilic (2016) <https://doi.org/10.1007/s41060-017-0062-1>.

Examples

Run this code
# NOT RUN {
#Generate a dataframe with 2 columns containing random values.

# Check a range of columns.
validate_data("2,3,4", ncol(data.frame(x1=sample(1:100,10),
x2=sample(500:1000, 10), x3=sample(-100:0,10))))

# Check a single column.

validate_data("2", ncol(data.frame(x1=sample(1:100,10),
x2=sample(500:1000, 10))))

# }

Run the code above in your browser using DataLab