sc_cols_bounded_below: Checks that all elements from the given columns are above a...

Description Usage Arguments Value Examples

View source: R/convenience.R

Description

Checks that all elements from the given columns are above a certain number

Usage

1
2
3
4
5
6
7
sc_cols_bounded_below(
  object,
  cols,
  lower_bound,
  include_lower_bound = TRUE,
  ...
)

Arguments

object

table with a columns specified by cols

cols

vector of characters of columns that are checked against the specified range

lower_bound

elements of the specified columns must be above this bound

include_lower_bound

if TRUE (default), elements are allowed to be equal to the lower_bound

...

further parameters that are passed to add_sanity_check.

Value

list of logical vectors where TRUE indicates where the check failed. Every list entry represents one of the columns specified in cols. This might be helpful if one wants to apply a counter-measure

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
d <- data.frame(a = c(0, 0.2, 3, Inf), b = c(1:4))
dummy_call <- function(x) {
  sc_cols_bounded_below(
    object = d, cols = c("a", "b"),
    lower_bound = 0.2,
    include_lower_bound = FALSE,
    description = "Measurements are expected to be bounded from below")
}
dummy_call(x = d)
get_sanity_checks()

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