isSupported: Check if a variable has a class supported by dataReporter

Description Usage Arguments Value See Also Examples

View source: R/isSupported.R

Description

A checkFunction that checks if v has one of the classes supported by dataReporter, namely character, factor, numeric, integer, labelled, haven_labelled, logical and Date (inlcuding other classes that inherits from any of these classes). A user supported list can be provided in the treatXasY argument, which will let the user decide how unsupported classes should be treated. This function is intended for use as a precheck in makeDataReport.

Usage

1

Arguments

v

A variable (vector) to check. All variable types are allowed.

Value

A checkResult with three entires: $problem (a logical indicating whether v contains only one value), $message (if a problem was found, a message describing which single value the variable takes and how many missing observations it contains, otherwise ""), and $problemValues (always NULL).

See Also

check, allCheckFunctions, checkFunction, checkResult

Examples

1
2
3
4
5
integerVar <- 1:10 #supported
rawVar <- as.raw(1:10) #not supported

isSupported(integerVar)
isSupported(rawVar)

dataReporter documentation built on Nov. 11, 2021, 9:06 a.m.