sc_col_elements: Checks that the elements of a column belong to a certain set

Description Usage Arguments Value Examples

View source: R/convenience.R

Description

Checks that the elements of a column belong to a certain set

Usage

1
sc_col_elements(object, col, feasible_elements, ...)

Arguments

object

table with a column specified by col

col

name as a character of the column which is checked

feasible_elements

vector with characters that are feasible for col. Note that an element that is NA it is always counted as a fail if feasible_elements does not explicitly contains NA.

...

further parameters that are passed to add_sanity_check.

Value

see return object of add_sanity_check

Examples

1
2
3
4
5
6
d <- data.frame(type = letters[1:4], nmb = 1:4)
dummy_call <- function(x) {
  sc_col_elements(object = d, col = "type", feasible_elements = letters[2:4])
}
dummy_call(x = d)
get_sanity_checks()

sanityTracker documentation built on April 22, 2020, 5:09 p.m.