Changelog
Source:NEWS.md
Version 2.3.3
CRAN release: 2025-08-18
- Fixed a minor bug in
allMissing()for complex numbers where either the real part or the imaginary part was missing while the other part was not missing (#279). - Dropped usage for internal C function
isFrame()for recent R versions (278). - Improved documentation (#273, #264).
Version 2.3.0
CRAN release: 2023-10-25
-
NULLis not longer considered to be atomic in future versions of R (c.f. https://stat.ethz.ch/pipermail/r-devel/2023-September/082892.html). To avoid breaking reverse dependencies, checkmate will stick to the old behavior until further notice. - Fixed a warning in
checkAtomic()(#245).
Version 2.1.0
CRAN release: 2022-04-21
- New arguments
n.charsandmax.charsforcheckCharacter()andcheckString(). - Checks for integerish now compare the tolerance with the difference to the nearest integer with
>instead of>=to allow specifying a tolerance of exactly0(#177). - Checks for integerish now check for class
DateanPOSIXt. - Coercion of double to integer in
assertInt()andassertIntegerish()now round to the nearest integer instead of always rounding viatrunc(). - Fixed an error message where the wrong variable name was reported by
assert()(#182). - Checks on POSIXct dates with storage mode integer should now work instead of raising an exception (#175).
-
*Matrix()and*Array()now allow different storage types than the one specified if all values are missing (#184). - Function
assert()now supports collecting assertions viaAssertCollection(#112). - New exported C function
qcheck()(#180). - Fixed a bug in
checkFunction(..., ordered = TRUE)(#204). - Removed deprecated S macro
DOUBLE_EPSfrom C source.
Version 2.0.0
CRAN release: 2020-02-06
- Expectations now optionally support the package
tinytest.tinytestis used as backend if it is attached, otherwise checkmate defaults totestthat. There is now also a vignette on how to setupcheckmatefortinytest. - Coercion now only affects double vectors.
- Improved error message for type detection in
*List. - Removed
*Bit, thebitpackage is orphaned. - Fixed documentation.
Version 1.9.4
CRAN release: 2019-07-04
- Fixed factors being detected as integerish.
- Fixed error message for name checks of vectors.
Version 1.9.3
CRAN release: 2019-05-03
- New argument
extensionforcheckPathForOutput()(#162). - Fixed handling of different NA types in all set functions (#158).
-
expect_vectorremoved due to a nameclash with packagetestthat.
Version 1.9.2
-
assert*(..., coerce = TRUE)does not drop names during conversion (#157), thanks to @mb706. - Fixed documentation in
checkDataFrame(#159), thanks to @harvey131. - Changed heuristic in
vname()to improve lookup of variable names.
Version 1.9.1
CRAN release: 2019-01-15
- Fix segfault on Solaris
- Fix warnings reported by rchk
- Fix checking private slots in
checkR6(#156)
Version 1.9.0
CRAN release: 2019-01-09
- Error messages now provide more information about error locations, e.g., the position of the first missing element in a vector.
- If the object to check is missing,
assert-functions now give a better error message,test-functions are alwaysFALSEandexpect-functions always raise an exception. - Checks for missingness and sort order optimized for ALTREPs.
- The calling frame reported in assertions is now identical to the calling frame reported by R’s
stop()function (#117). - Added
checkDoubleto explicitly check for non-integer numerics. - Added
checkRawto check raw vectors. - Added
checkFormulato check formula objects. - Added
checkMultiClassto check for inheritance from a set of candidates - Added
checkDisjunctto check sets for being disjunct. - Added abbreviation
"p"to qassert to check for POSIXct objects. - Added argument
coercetoassertCount/assert_count,assertInt/assert_intandassertIntegerish/assert_integerishwhich optionally coercesxto integer after an successful assertion. This supersedes the functionsasCount,asIntandasInteger(#77). - Added arguments
max.rowsandmax.colsto check for maximum number of rows and columns for matrices, data.frames, tibbles and data.tables. - Added argument
disjunct.fromto*Names. - Fixed an error message in
checkChoice. - Fixed
*Functionto work properly with Primitives. - Fixed
*Listwhere the check for missingness was broken. - Workaround for
*DataTablefor the detection of the number of rows of null data.tables: https://github.com/Rdatatable/data.table/issues/3149
Version 1.8.5
CRAN release: 2017-10-24
- Added
*POSIXctto check POSIXct data-time objects in POSIXct format. - The set functions optionally support the package
fastmatchnow. - Argument
sorted = TRUEis not passed tols()anymore to support R versions prior to v3.2.0.
Version 1.8.4
CRAN release: 2017-09-25
- New functions to test bit vectors implemented in package
bit. - New functions to test R6 classes implemented in package
R6. - Always load (not attach) the respective namespace if checking for objects of type
data.table,tibble,R6orbit. This ensures that all operations work as expected after the check. -
*Nameswithtype="unnamed"now works withNULL. - New argument
must.includefor*Names. - Fixed possible protection stack imbalance as reported by
rchk.
Version 1.8.3
CRAN release: 2017-07-03
- New argument
sorted(defaults toFALSE) for*Integer,*IntegerishandNumericto check for ascending order of vector elements. - New argument
null.ok(defaults toFALSE) for*Choiceand*Class. -
*Subsetnow allows to pass empty vectors tochoices. - Improved error message for
*Choice. - The set family of functions is now more restrict regarding the class, e.g. they differentiate between factors and characters.
-
*Characterand*Stringnow ignores missing values in regular expressions and for string length checks (using argumentmin.chars). To disallow missing values, setany.missingorna.ok, respectively. -
*Datenow ignores missing values in for lower/upper bound checks. To disallow missing values, setany.missingtoFALSE. Thanks to Will Beasley (@wibeasley) for the PR. - Package
microbenchmarkis no longer strictly required to build the vignette. If not installed, some output and figures will be missing though.
Version 1.8.2
CRAN release: 2016-11-02
-
*Matrixand*Arraynow additionally allow to check for integerish storage type via argument “mode”. - Functions
*Count,*Int,*Number,*Integer,*Integerishand*Numericdo not accept logical values any more. -
checkAtomicVectoris now more restrictive and prohibits a dimension symbol. Thus, a matrix is not considered an atomic vector any more. - Dropped support for AssertCollections in convert functions (
asInt,asIntegerandasCount). - Added
checkTibble.
Version 1.8.1
CRAN release: 2016-06-28
- Function
test_fileis longer exported. -
*Functiondoes not longer lookup functions withmatch.fun. As a result, passing functions via the string of the function name stopped working. - In
qassertusingfas first char in a rule now specifies factor (before: function).
Version 1.8.0
CRAN release: 2016-06-06
- Most functions now support the handling of default arguments encoded as
NULLvia argumentnull.ok. - Functions
*Fileand*Directoryare deprecated due to name clashes and will be removed in a future version. Please use*FileExistsor*DirectoryExistsinstead. - New helper function
matchArgto provide a simple an easy way for partial argument matching in combination with an AssertCollection. - Added alias functions for all check functions (
check_*) to provide support for the underscore programming style inassert().
Version 1.7.4
CRAN release: 2016-04-08
- Compatibility with the upcoming testthat version.
-
expect_functions now return the checked object invisibly. - Changed default of argument
.var.namefor assertions andlabelfor expectations: They now default to the return value of the exported functionvname(instead of missing which confuses some linters). - Fixed error message in convert functions: Variable name was not properly looked up by the heuristic.
- Fixed a bug in
qassertrandqtestrwhere the error message was not properly generated if multiple rules were provided. - New argument
depthforqtestrto control the recursion depth while checking nested lists.
Version 1.7.3
CRAN release: 2016-03-10
- Added
checkDate. - Argument
.var.nameof assert functions now has as default value (instead of missing). - Fixed a bug in
*OSfunctions. - Fixed a bug in
*Directoryfunctions. - New argument
extensionfor the*Filefamily of functions.
Version 1.7.2
CRAN release: 2016-02-25
- Added
checkOS(). - Argument
fixedfor*Characterfunctions now accepts a string instead of a boolean value and thus can directly be used for a substring search. - New arguments
min.chars,pattern,fixedandignore.casefor the*Stringfamily of functions. - Exported helper functions
wf(which.first) andwl(which.last). - Now importing the new backports package for functions
lengths()anddir.exists.
Version 1.7.1
CRAN release: 2016-02-02
- Fixed a segfault while checking an upper bound in qassert/qtest.
- Some minor speedups
Version 1.7.0
CRAN release: 2016-01-23
- Added alias functions for all functions to support the underscore style, e.g.
assert_numericis the new alias forassertNumericandtest_matrixis the alias fortest_matrix. - All assert functions now invisibly return the tested object instead of
TRUEand thus can be used with magrittr pipes. - Improved speed for most functions by reducing the .Call overhead (Thanks to Hadley Wickham).
- Added
*DataTablefunctions to properly test primary and secondary keys of data tables. - Removed
*Percentagefamily of functions. - Exported functions
makeAssertion,makeTestandmakeExpectationto assist expanding the package with user-generated checks. - Added functions
makeAssertionFunction,makeTestFunctionandmakeExpectationFunctionto automatically create the respective functions based on a provided check function.
Version 1.6.3
CRAN release: 2015-10-23
- Assertions can now be collected (via
makeAssertCollection()) and reported (viareportAssertions()). -
qassert()can now perform bound checks on strings. - The default for the parameter “ordered” of the
*SetEqualfunctions is now set to FALSE, as described in the documentation.
Version 1.6.2
CRAN release: 2015-07-26
- Fixed a compile-time warning.
- checkmate does not import
testthatanymore in order to speed up package loading times and to keep the dependencies at a minimum. Theexpect_*family of functions can still be used, the namespace will be loaded on demand.
Version 1.6.1
CRAN release: 2015-07-17
- New family of functions:
expect_*is intended to be used in combination with testthat. But note that functionsexpect_null()andexpect_named()are not provided to avoid name clashes with testthat. - Added
qexpect()andqexpectr(). - Added argument
all.missingfor checks of matricies and data frames. - Added
anyNaN(). - Clarified documentation for
assert()andallMissing(). - Fixed a bug where bound checks were performed on missing values.
- Fixed a bug where missingness was not correctly detected in data frames.
Version 1.6.0
CRAN release: 2015-06-19
- Started to support long vectors.
- Added a short vignette.
- Improved documentation.
- New argument “combine” for
assert()to allow combining check functions with an AND instead of an OR.
Version 1.5.3
CRAN release: 2015-05-13
- Fixed a bug regarding the number of rows in zero-column data frames.
- Fixed a bug where the type of lists with dimension attribute where reported as “array” or “matrix”.
- Family *Array: new arguments “min.d” and “max.d”.
- Family Array and Matrix: Argument “mode” now additionally accepts strings “list” and “atomic”.
Version 1.5.2
CRAN release: 2015-03-20
- Fixed:
(assert|check|test)Character(NA_character_, min.chars = 1)does not eval to TRUE anymore. - New arguments for
*Factorfunctions:(n|min|max).levels. - Improved error messages for type and length checks.
- Improved error messages for missing arguments.
Version 1.5.1
CRAN release: 2014-12-14
- Included a workaround for R’s nrow and ncol to properly work with data frames.
- Fixed a bug handling complex number in checks for integerish values.
- Improved documentation.
Version 1.5.0
CRAN release: 2014-10-19
- Added
checkNames(). - Added
checkPercentage(). - Added
anyInfinite(). - Fixed error messages for some dimension checks.
- Fixed an error while checking numerics for finiteness.
Version 1.4
CRAN release: 2014-09-03
- Fixed a bug where rownames and colnames of data.frames where not retrieved correctly.
- Fixed a bug in
checkVector()(wrong order of arguments in call to C). - Filesystem access: checks for write and executable rights are now disabled on windows.
Version 1.3
CRAN release: 2014-08-15
- Fixed a bug where logical values passed a check for numerics in
qassert. - Family
*SetEqual: new argument “ordered”. -
checkPathForOutput: new argument “overwrite”.
Version 1.2
CRAN release: 2014-07-21
- Fixed bug in checkList.
- Fixed dimnames check on empty matrices and data frames.
- Added
*SetEqualfunctions.
Version 1.1
CRAN release: 2014-06-28
- Improved error messages in
assert*functions. - New argument ‘empty.ok’ for
*Subsetfunctions. -
assert()now returns TRUE invisibly (as documented). - Fixed handling of zero-length arguments in
checkFunction(). - Fixed error message if duplicated values where found.
- Fixed a missing check for row names in
checkMatrixandcheckDataFrame.