checkmate v1.9.3

0

Monthly downloads

0th

Percentile

Fast and Versatile Argument Checks

Tests and assertions to perform frequent argument checks. A substantial part of the package was written in C to minimize any worries about execution time overhead.

Readme

checkmate

CRAN_Status_Badge Build Status Build status Coverage Status Download Stats

Fast and versatile argument checks for R.

Ever used an R function that produced a not-very-helpful error message, just to discover after minutes of debugging that you simply passed a wrong argument?

Blaming the laziness of the package author for not doing such standard checks (in a dynamically typed language such as R) is at least partially unfair, as R makes theses types of checks cumbersome and annoying. Well, that's how it was in the past.

Enter checkmate.

Virtually every standard type of user error when passing arguments into function can be caught with a simple, readable line which produces an informative error message in case. A substantial part of the package was written in C to minimize any worries about execution time overhead. Furthermore, the package provides over 30 expectations to extend the popular testthat package for unit tests.

Installation

For the stable release, just install the latest version from CRAN:

install.packages("checkmate")

For the development version, use devtools:

devtools::install_github("mllg/checkmate")

Resources

Functions in checkmate

Name Description
checkAtomic Check that an argument is an atomic vector
checkAtomicVector Check that an argument is an atomic vector
checkEnvironment Check if an argument is an environment
checkDate Check that an argument is a Date
checkAccess Check file system access rights
checkDirectoryExists Check for existence and access rights of directories
AssertCollection Collect multiple assertions
checkFALSE Check if an argument is FALSE
checkNull Check if an argument is NULL
checkNumber Check if an argument is a single numeric value
asInteger Convert an argument to an integer
checkCharacter Check if an argument is a vector of type character
anyInfinite Check if an object contains infinite values
checkBit Check if an argument is a bit vector
checkFactor Check if an argument is a factor
assert Combine multiple checks into one assertion
checkArray Check if an argument is an array
checkFileExists Check existence and access rights of files
checkDisjunct Check if an argument is disjunct from a given set
checkDataFrame Check if an argument is a data frame
checkDouble Check that an argument is a vector of type double
checkInteger Check if an argument is vector of type integer
checkFunction Check if an argument is a function
checkDataTable Check if an argument is a data table
checkNamed Check if an argument is named
checkNames Check names to comply to specific rules
makeTest Turn a Check into a Test
checkR6 Check if an argument is a R6 class
checkmate-package checkmate: Fast and Versatile Argument Checks
checkRaw Check if an argument is a raw vector
matchArg Partial Argument Matching
checkInt Check if an argument is a single integerish value
checkComplex Check if an argument is a vector of type complex
vname Lookup a variable name
checkIntegerish Check if an object is an integerish vector
checkCount Check if an argument is a count
%??% Coalesce operator
checkNumeric Check that an argument is a vector of type numeric
checkMatrix Check if an argument is a matrix
checkScalar Check if an argument is a single atomic value
checkOS Check the operating system
wf Get the index of the first/last TRUE
checkScalarNA Check if an argument is a single missing value
allMissing Check if an object contains missing values
makeAssertion Turn a Check into an Assertion
makeExpectation Turn a Check into an Expectation
checkTibble Check if an argument is a tibble
checkMultiClass Check the class membership of an argument
checkVector Check if an argument is a vector
checkSetEqual Check if an argument is equal to a given set
checkString Check if an argument is a string
anyNaN Check if an object contains NaN values
checkChoice Check if an object is an element of a given set
checkClass Check the class membership of an argument
checkSubset Check if an argument is a subset of a given set
checkTRUE Check if an argument is TRUE
qassert Quick argument checks on (builtin) R types
qassertr Quick recursive arguments checks on lists and data frames
checkFlag Check if an argument is a flag
checkFormula Check if an argument is a formula
checkList Check if an argument is a list
checkLogical Check if an argument is a vector of type logical
checkPOSIXct Check that an argument is a date/time object in POSIXct format
checkPathForOutput Check if a path is suited for creating an output file
No Results!

Vignettes of checkmate

Name
checkmate.Rmd
No Results!

Last month downloads

Details

Type Package
URL https://github.com/mllg/checkmate
URLNote https://github.com/mllg/checkmate
BugReports https://github.com/mllg/checkmate/issues
NeedsCompilation yes
ByteCompile yes
Encoding UTF-8
License BSD_3_clause + file LICENSE
VignetteBuilder knitr
RoxygenNote 6.1.1
Collate 'AssertCollection.R' 'allMissing.R' 'anyInfinite.R' 'anyMissing.R' 'anyNaN.R' 'asInteger.R' 'assert.R' 'helper.R' 'makeExpectation.R' 'makeTest.R' 'makeAssertion.R' 'checkAccess.R' 'checkArray.R' 'checkAtomic.R' 'checkAtomicVector.R' 'checkBit.R' 'checkCharacter.R' 'checkChoice.R' 'checkClass.R' 'checkComplex.R' 'checkCount.R' 'checkDataFrame.R' 'checkDataTable.R' 'checkDate.R' 'checkDirectoryExists.R' 'checkDisjunct.R' 'checkDouble.R' 'checkEnvironment.R' 'checkFALSE.R' 'checkFactor.R' 'checkFileExists.R' 'checkFlag.R' 'checkFormula.R' 'checkFunction.R' 'checkInt.R' 'checkInteger.R' 'checkIntegerish.R' 'checkList.R' 'checkLogical.R' 'checkMatrix.R' 'checkMultiClass.R' 'checkNamed.R' 'checkNames.R' 'checkNull.R' 'checkNumber.R' 'checkNumeric.R' 'checkOS.R' 'checkPOSIXct.R' 'checkPathForOutput.R' 'checkR6.R' 'checkRaw.R' 'checkScalar.R' 'checkScalarNA.R' 'checkSetEqual.R' 'checkString.R' 'checkSubset.R' 'checkTRUE.R' 'checkTibble.R' 'checkVector.R' 'coalesce.R' 'isIntegerish.R' 'matchArg.R' 'qassert.R' 'qassertr.R' 'vname.R' 'wfwl.R' 'zzz.R'
Packaged 2019-05-03 21:04:10 UTC; michel
Repository CRAN
Date/Publication 2019-05-03 21:40:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/checkmate)](http://www.rdocumentation.org/packages/checkmate)