knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

checkr

Travis build status Codecov test coverage

Object conformance checking made easy.

Installation

You can install the released version of checkr from CRAN with:

install.packages("checkr")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("kkmann/checkr")

Example

This is a basic example which shows you how to solve a common problem:

library(checkr)

f <- function(positive) {

    evaluate(ge(0), positive)

    # we need to do something useful (throw errors etc later)

}

f(1)
f(-1)

works for arrays as well:

g <- function(some_array = matrix(1:4, nrow = 2)) {
    evaluate(ge(3), some_array) 
}
cat(g())


kkmann/checkr documentation built on May 8, 2019, 1:20 p.m.