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.


checkmate

CRAN_Status_Badge R build 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

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("checkmate")

2.3.4 by Michel Lang, 9 months ago


https://mllg.github.io/checkmate/, https://github.com/mllg/checkmate


Report a bug at https://github.com/mllg/checkmate/issues


Browse source code at https://github.com/cran/checkmate


Authors: Michel Lang [cre, aut] , Bernd Bischl [ctb] , Dénes Tóth [ctb]


Documentation:   PDF Manual  


BSD_3_clause + file LICENSE license


Imports backports, utils

Suggests R6, fastmatch, data.table, devtools, ggplot2, knitr, magrittr, microbenchmark, rmarkdown, testthat, tinytest, tibble


Imported by APCtools, BBmisc, BSW, BasicStatsPlots, BatchExperiments, BatchJobs, BayesFBHborrow, BayesFM, BayesianMCPMod, Bchron, BioTIMEr, CDMConnector, Characterization, CohortGenerator, CohortIncidence, CohortMethod, ColOpenData, CrossClustering, DCCA, DTSg, DatabaseConnector, DiscreteDatasets, DiscreteFDR, DiscreteFWER, DiscreteTests, DistributionIV, DoubleML, DrugExposureDiagnostics, EDI, EFAfactors, EFAtools, EFSATools, EGM, EpiNow2, FCO, FDX, FeatureExtraction, Gmisc, GreedyExperimentalDesign, HaDeX2, HospitalNetwork, HyMETT, IBMPopSim, ICEbox, IssueTrackeR, IxPopDyMod, KMunicate, LABTNSCPSS, MBNMAdose, MBNMAtime, MplusAutomation, NetCoupler, NetworkInference, OBIC, OdysseusCharacterizationModule, OhdsiShinyAppBuilder, OncoBayes2, OpenML, PKNCA, PKbioanalysis, PNADCperiods, PTE, PaRe, ParamHelpers, ParmOff, PatientGenerator, RBPcurve, RBesT, RChASM, RDML, REDCapR, REDCapSync, REDCapTidieR, REXoplanets, RIFanalysis, RMediation, ROI, ROI.plugin.qpoases, RPhosFate, RestRserve, ResultModelManager, Rigma, RobinCID, RobinCar2, RprobitB, SAMprior, SCDB, SPEI, SSVS, STARRS, SeedMaker, SelfControlledCaseSeries, SelfControlledCohort, SpaDES.tools, SqlRender, TBox, TKApprox, TSEAL, TTR.PGM, TestGenerator, TreatmentPatterns, TrialEmulation, WhatsR, aRD, accessibility, admixr2, adproclus, aeddo, aedseo, ahocorasick, aldvmm, amt, ao, aopdata, aslib, astgrepr, autocogs, autotest, autothresholdr, baRulho, babelmixr2, bartMachine, baselinenowcast, batchtools, bayesDiagnostics, bayesSSM, baytaAAR, bbk, bbotk, bclogit, beaver, bhmbasket, bidsr, biobouncer, biocohort, biomes, bitfield, bonsaiforest, boostrq, bootGOF, botor, brandr, brclimr, brpop, bscm, bssm, camtrapR, carbonr, caretSDM, causalDisco, causalPAF, causaldef, causalweight, censobr, centerline, cfr, checkCLI, chevron, choicedata, chooseGCM, ci, cito, cld, cleanepi, cleanr, clustree, cnefetools, coalitions, codified, codyna, cointReg, comorbidity, concstats, connector, connector.databricks, connector.sharepoint, contdid, cosimmr, counterfactuals, cre.dcf, crmPack, crosstable, crumble, ctoclient, cucumber, cvms, cyclestreets, dapper, dataverse, date4ts, dbSpatial, detrendr, discharge, discretes, diseasystore, distfromq, distilleR, distionary, distplyr, document, dsem, dunlin, dynamite, easybio, eatRep, eatTools, ebvcube, ecostate, ecr, emodnet.wfs, enderecobr, epichains, epicmodel, epidatr, epidist, epiparameter, eplusr, eppoFindeR, exampletestr, excerptr, exnexSurv, fHMM, fail, famish, farff, fastLogisticRegressionWrap, fastVoteR, fastreg, ffscrapr, filesstrings, finalsize, flipdownr, fmeffects, foresty, formatdown, formatters, framework, funStatTest, future.batchtools, gRaphiaExtra, geboes.score, geobr, geocodebr, ggPMX, ggbrain, ggparty, ggplot2.utils, ggpsychro, ggstratify, ggtibble, glydraw, glymotif, glyparse, glyrepr, godley, gofreg, grapherator, grattan, gridstackeR, groupdata2, gtfs2emis, gtfs2gps, gtfstools, guess, hcruR, hdf5r.Extra, hdflex, hdm, hetu, hidradenitis, highs, holiglm, htmlTable, hubUtils, hydroState, icmstate, icpack, ie2misc, ijtiff, imaginator, iml, immunarch, immundata, inDAGO, injurytools, inlcolor, inlpubs, innsight, ino, install.load, ipeaplot, ivo.table, journalR, junco, kgen, ladder, lazysql, ldaPrototype, leafdown, learnr, legiretraite, libcmaesr, limorhyde2, linelist, llama, lmtp, logolink, longmixr, loo, lotri, mallet, maraca, marginaleffects, markmyassignment, matchedcc, maths.genealogy, matrixprofiler, mcMST, mcboost, mcparallelDo, mcradds, mctq, md4r, medfit, melt, metR, metaRange, microdatasus, midfieldr, miesmuschel, mifa, mini007, miniPCH, mlr, mlr3, mlr3automl, mlr3batchmark, mlr3benchmark, mlr3cluster, mlr3db, mlr3fairness, mlr3fda, mlr3filters, mlr3forecast, mlr3fselect, mlr3hyperband, mlr3inferr, mlr3learners, mlr3mbo, mlr3measures, mlr3misc, mlr3oml, mlr3pipelines, mlr3resampling, mlr3spatial, mlr3spatiotempcv, mlr3summary, mlr3superlearner, mlr3torch, mlr3tuning, mlr3tuningspaces, mlr3viz, mlrCPO, mlrMBO, mlrintermbo, mmrm, modelimportance, modelsummary, monolix2rx, mregions2, muiMaterial, muttest, mvMAPIT, nandb, nat.utils, nestcolor, netify, nlmixr2est, nlmixr2extra, nlmixr2lib, nlmixr2save, nlmixr2scm, nlmixr2targets, nonmem2rx, npi, nseq, oaii, occumb, oeli, ohun, omophub, openFDA, opentripplanner, optimizeR, ordbetareg, osdc, otpr, packager, packcircles, pammtools, paradox, parallelMap, parsermd, pcpr, pdfminer, phers, photosynthesis, pixiedust, pkggraph, pkgmatch, pkgstats, pleioh2g, pmwg, pmxNODE, portvine, posterior, precrec, priorityelasticnet, prioritylasso, priorsense, proverbs, psborrow2, pushoverr, pvda, pxweb, quest, quid, r5r, rATTAINS, rJavaEnv, radous, random.cdisc.data, rasciidoc, rcrisp, rdborrow, rdomains, reactRouter, reactable.extras, readepi, rearrr, redcapAPI, retel, rflsgen, ria.test, ringbp, risk.assessr, rjd3production, rjd3toolkit, rjstat, rlistings, robnptests, rollinglda, romic, rosmium, rotulador, rrandvec, rsimsum, rsprite2, rsurveycto, rtables, rtables.officer, rtestim, rush, rwarrior, rxode2, rxode2lincmt, rxode2ll, sacRebleu, safeframe, sanityTracker, sasr, savvyr, sceua, schemate, scorepeak, scoringutils, sdcLog, seekr, segregation, semEffect, semantic.dashboard, seqHMM, serofoi, sevenbridges2, shelter, shiny.blueprint, shiny.telemetry, shinydisconnect, shinymrp, shinytest2, simIDM, simfinapi, simmr, simulist, sjSDM, slideimp, smcfcs, sobol, socialmixr, softbib, sorvi, spINAR, spanishoddata, sparsevar, sspm, stabm, stanza, stopmotion, str2str, strata, stratallo, stratigraphr, strex, summarytools, supabaseR, superspreading, survdistr, survinger, suwo, sweidnumbr, synadam, tabshiftr, teal, teal.code, teal.data, teal.modules.clinical, teal.modules.general, teal.picks, teal.reporter, teal.slice, teal.transform, teal.widgets, tealeaves, tern, tern.gee, tern.mmrm, test.assessr, tf, tidier, tidyMC, tidycreel, tidyhte, tidynorm, tidyrates, tidyrules, tidysq, tinyVAST, tna, topiclabels, trackopt, transportr, triact, truchet, tsmp, tspmeta, tuber, tubern, typetracer, uci, undomanager, usefun, uteals, vaccineff, virustotal, vntrs, vvauditor, vvconverter, webmap, xlamisc, xnicher, xpectr, xplaineff, xplainfi, xportr, xpose.xtras, xsdm, xtdml, xtifedml, xxdi, zendown, zmisc.

Depended on by SeqExpMatch, cmaesr, forestplot, smoof.

Suggested by Orcs, base64url, bsitar, dbMatrix, deident, epiCo, fitbitr, fritools, fritools2, fuseMLR, gimms, harf, htaBIM, icecream, maicplus, replacer, treePlotArea, zephyr.


See at CRAN