Skip to contents

Provide validator for certain relevant fields of data that needs to be send to the API

Methods


Method valid_sex()

Validate sex column of a dataframe as positive integer

Usage

FieldValidation$valid_sex(df, field)

Arguments

df

dataframe where the values of the field are

field

field name


Method valid_bool_vector()

Validate all values of a column are indeed boolean and not equivalents

Usage

FieldValidation$valid_bool_vector(df, field)

Arguments

df

dataframe where the values of the field are

field

field name


Method validate_datetime()

Validate all values of a column are either datetime in ymd_hms format or a date in ymd format.

Usage

FieldValidation$validate_datetime(df, field, is_datetime = TRUE)

Arguments

df

dataframe where the values of the field are

field

field name

is_datetime

boolean flag indicating whether to check datetime or date


Method check_na_fields()

Check whether there are NA values in some columns of a given dataframe

Usage

FieldValidation$check_na_fields(df, col_names)

Arguments

df

dataframe

col_names

character vector with the columnnames


Method clone()

The objects of this class are cloneable with this method.

Usage

FieldValidation$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.