check_values: Check values

View source: R/check_values.R

check_valuesR Documentation

Check values

Description

Checks if values in variables are valid according to the 'values' and 'type' dictionary attributes.

Usage

check_values(
  data,
  replace = NULL,
  return = TRUE,
  report = FALSE,
  include_missing = FALSE,
  integer_as_float = FALSE,
  check_type = TRUE
)

Arguments

data

A data frame

replace

Value which relaces unvalid values (e.g., NA).

return

If TRUE, a data frame is returned with replaced values.

report

If TRUE, an overview of invalid values will be given.

include_missing

If TRUE, missing values (provided as 'missing' in the dic file) will be considered as valid values.

integer_as_float

If TRUE, type 'integer' will be handled as 'float'. That is, only values outside the minimum and the maximum of the provided valid values will be considered invalid.

check_type

If TRUE, it will check if the class of a variable conflicts with the 'type' as defined in the dic information. When a type is numeric and the class is 'character' it will try to convert the class to a numeric class.

Value

A data frame with replaced values if replaces is not NULL.

Examples

check_values(ex_itrf, return = FALSE)

jazznbass/scaledic documentation built on July 19, 2023, 12:50 a.m.