util_check_data_type: Verify the data type of a value

View source: R/util_check_data_type.R

util_check_data_typeR Documentation

Verify the data type of a value

Description

Function to verify the data type of a value.

Usage

util_check_data_type(
  x,
  type,
  check_convertible = FALSE,
  threshold_value = 0,
  return_counts = FALSE
)

Arguments

x

the value

type

expected data type

check_convertible

logical also try, if a conversion to the declared data type would work.

threshold_value

numeric from=0 to=100. percentage failing conversions allowed if check_convertible is TRUE.

return_counts

logical return the counts instead of logical values about threshold violations.

Value

if check_convertible is FALSE, logical whether x is of the expected type if check_convertible is TRUE integer with the states ⁠0, 1, 2⁠: 0 = Mismatch, not convertible 1 = Match 2 = Mismatch, but convertible


dataquieR documentation built on July 26, 2023, 6:10 p.m.