Unit Testing for R

A unit testing system designed to be fun, flexible and easy to set up.


Testing your code is normally painful and boring. testthat tries to make testing as fun as possible, so that you get a visceral satisfaction from writing tests. Testing should be fun, not a drag, so you do it all the time. To make that happen, testthat:

  • Provides functions that make it easy to describe what you expect a function to do, including catching errors, warnings and messages.

  • Easily integrates in your existing workflow, whether it's informal testing on the command line, building test suites or using R CMD check.

  • Can re-run tests automatically as you change your code or tests.

  • Displays test progress visually, showing a pass, fail or error for every expectation. If you're using the terminal, it'll even colour the output.

testthat draws inspiration from the xUnit family of testing packages, as well from many of the innovative ruby testing libraries, like rspec, testy, bacon and cucumber. I have used what I think works for R, and abandoned what doesn't, creating a testing environment that is philosophically centred in R.

Instructions for using this package can be found in the Testing chapter of R packages.

If you're using testthat in a package, you should put your tests in tests/testthat. Each test file should start with test and end in .R or .r. To ensure R CMD check runs your tests, place the following code in tests/testthat.R:

library(testthat)
library(yourpackage)
 
test_check("yourpackage")

Also make sure to add Suggests: testthat to your DESCRIPTION.

News

testthat 1.0.2

  • Ensure 'std::logic_error()' constructed with 'std::string()' argument, to avoid build errors on Solaris.

testthat 1.0.1

  • New expect_output_file() to compare output of a function with a text file, and optionally update it (#443, @krlmlr).

  • Properly scoped use + compilation of C++ unit testing code using Catch to gcc and clang only, as Catch includes code that does not strictly conform to the C++98 standard. (@kevinushey)

  • Fixed an out-of-bounds memory access when routing Catch output through Rprintf(). (@kevinushey)

  • Ensure that unit tests run on R-oldrel (remove use of dir.exists()). (@kevinushey)

  • Improved overriding of calls to exit() within Catch, to ensure compatibility with GCC 6.0. (@krlmlr)

  • Hardened formatting of difference messages, previously the presence of % characters could affect the output (#446, @krlmlr).

  • Fixed errors in expect_equal() when comparing numeric vectors with and without attributes (#453, @krlmlr).

  • auto_test() and auto_test_package() show only the results of the current test run and not of previously failed runs (#456, @krlmlr).

testthat 1.0.0

The expectation() function now expects an expectation type (one of "success", "failure", "error", "skip", "warning") as first argument. If you're creating your own expectations, you'll need to use expect() instead (#437).

The expectation system got a thorough overhaul (#217). This primarily makes it easier to add new expectations in the future, but also included a thorough review of the documentation, ensuring that related expectations are documented together, and have evocative names.

One useful change is that most expectations invisibly return the input object. This makes it possible to chain together expectations with magrittr:

factor("a") %>% 
  expect_type("integer") %>% 
  expect_s3_class("factor") %>% 
  expect_length(1)

(And to make this style even easier, testthat now re-exports the pipe, #412).

The exception to this rule are the expectations that evaluate (i.e. for messages, warnings, errors, output etc), which invisibly return NULL. These functions are now more consistent: using NA will cause a failure if there is a errors/warnings/mesages/output (i.e. they're not missing), and will NULL fail if there aren't any errors/warnings/mesages/output. This previously didn't work for expect_output() (#323), and the error messages were confusing with expect_error(..., NA) (#342, @nealrichardson + @krlmlr, #317).

Another change is that expect_output() now requires you to explicitly print the output if you want to test a print method: expect_output("a", "a") will fail, expect_output(print("a"), "a") will succeed.

There are six new expectations:

  • expect_type() checks the type of the object (#316), expect_s3_class() tests that an object is S3 with given class, expect_s4_class() tests that an object is S4 with given class (#373). I recommend using these more specific expectations instead of the more general expect_is().

  • expect_length() checks that an object has expected length.

  • expect_success() and expect_failure() are new expectations designed specifically for testing other expectations (#368).

A number of older features have been deprecated:

  • expect_more_than() and expect_less_than() have been deprecated. Please use expect_gt() and expect_lt() instead.

  • takes_less_than() has been deprecated.

  • not() has been deprecated. Please use the explicit individual forms expect_error(..., NA) , expect_warning(.., NA) and so on.

Now all expectations are also conditions, and R's condition system is used to signal failures and successes (#360, @krlmlr). All known conditions (currently, "error", "warning", "message", "failure", and "success") are converted to expectations using the new as.expectation(). This allows third-party test packages (such as assertthat, testit, ensurer, checkmate, assertive) to seamlessly establish testthat compatibility by issuing custom error conditions (e.g., structure(list(message = "Error message"), class = c("customError", "error", "condition"))) and then implementing as.expectation.customError(). The assertthat package contains an example.

The reporters system class has been considerably refactored to make existing reporters simpler and to make it easier to write new reporters. There are two main changes:

  • Reporters classes are now R6 classes instead of Reference Classes.

  • Each callbacks receive the full context:

    • add_results() is passed context and test as well as the expectation.
    • test_start() and test_end() both get the context and test.
    • context_start() and context_end() get the context.
  • Warnings are now captured and reported in most reporters.

  • The reporter output goes to the original standard output and is not affected by sink() and expect_output() (#420, @krlmlr).

  • The default summary reporter lists all warnings (#310), and all skipped tests (@krlmlr, #343). New option testthat.summary.max_reports limits the number of reports printed by the summary reporter. The default is 15 (@krlmlr, #354).

  • MinimalReporter correct labels errors with E and failures with F (#311).

  • New FailReporter to stop in case of failures or errors after all tests (#308, @krlmlr).

  • New functions capture_output(), capture_message(), and capture_warnings() selectively capture function output. These are used in expect_output(), expect_message() and expect_warning() to allow other types out output to percolate up (#410).

  • try_again() allows you to retry code multiple times until it succeeds (#240).

  • test_file(), test_check(), and test_package() now attach testthat so all testing functions are available.

  • source_test_helpers() gets a useful default path: the testthat tests directory. It defaults to the test_env() to be consistent with the other source functions (#415).

  • test_file() now loads helpers in the test directory before running the tests (#350).

  • test_path() makes it possible to create paths to files in tests/testthat that work interactively and when called from tests (#345).

  • Add skip_if_not() helper.

  • Add skip_on_bioc() helper (@thomasp85).

  • make_expectation() uses expect_equal().

  • setup_test_dir() has been removed. If you used it previously, instead use source_test_helpers() and find_test_scripts().

  • source_file() exports the function testthat uses to load files from disk.

  • test_that() returns a logical that indicates if all tests were successful (#360, @krlmlr).

  • find_reporter() (and also all high-level testing functions) support a vector of reporters. For more than one reporter, a MultiReporter is created (#307, @krlmlr).

  • with_reporter() is used internally and gains new argument start_end_reporter = TRUE (@krlmlr, 355).

  • set_reporter() returns old reporter invisibly (#358, @krlmlr).

  • Comparing integers to non-numbers doesn't raise errors anymore, and falls back to string comparison if objects have different lengths. Complex numbers are compared using the same routine (#309, @krlmlr).

  • compare.numeric() and compare.chacter() recieved another overhaul. This should improve behaviour of edge cases, and provides a strong foundation for further work. Added compare.POSIXt() for better reporting of datetime differences.

  • expect_identical() and is_identical_to() now use compare() for more detailed output of differences (#319, @krlmlr).

  • Added Catch v1.2.1 for unit testing of C++ code. See ?use_catch() for more details. (@kevinushey)

testthat 0.11.0

  • Handle skipped tests in the TAP reporter (#262).

  • New expect_silent() ensures that code produces no output, messages, or warnings (#261).

  • New expect_lt(), expect_lte(), expect_gt() and expect_gte() for comparison with or without equality (#305, @krlmlr).

  • expect_output(), expect_message(), expect_warning(), and expect_error() now accept NA as the second argument to indicate that output, messages, warnings, and errors should be absent (#219).

  • Praise gets more diverse thanks to the praise package, and you'll now get random encouragment if your tests don't pass.

  • testthat no longer muffles warning messages. If you don't want to see them in your output, you need to explicitly quiet them, or use an expectation that captures them (e.g. expect_warning()). (#254)

  • Use tests in inst/tests is formally deprecated. Please move them into tests/testthat instead (#231).

  • expect_match() now encodes the match, as well as the output, in the expectation message (#232).

  • expect_is() gives better failure message when testing multiple inheritance, e.g. expect_is(1:10, c("glm", "lm")) (#293).

  • Corrected argument order in compare.numeric() (#294).

  • comparison() constructure now checks its arguments are the correct type and length. This bugs a bug where tests failed with an error like "values must be length 1, but FUN(X[[1]]) result is length 2" (#279).

  • Added skip_on_os(), to skip tests on specified operating systems (@kevinushey).

  • Skip test that depends on devtools if it is not installed (#247, @krlmlr)

  • Added skip_on_appveyor() to skip tests on Appveyor (@lmullen).

  • compare() shows detailed output of differences for character vectors of different length (#274, @krlmlr).

  • Detailed output from expect_equal() doesn't confuse expected and actual values anymore (#274, @krlmlr).

testthat 0.10.0

  • Failure locations are now formated as R error locations.

  • Add an 'invert' argument to find_tests_scripts(). This allows one to select only tests which do not match a pattern. (#239, @jimhester).

  • Deprecated library_if_available() has been removed.

  • test (test_dir(), test_file(), test_package(), test_check()) functions now return a testthat_results object that contains all results, and can be printed or converted to data frame.

  • test_dir(), test_package(), and test_check() have an added ... argument that allows filtering of test files using, e.g., Perl-style regular expressions,or fixed character filtering. Arguments in ... are passed to grepl() (@leeper).

  • test_check() uses a new reporter specifically designed for R CMD check. It displays a summary at the end of the tests, designed to be <13 lines long so test failures in R CMD check display something more useful. This will hopefully stop BDR from calling testthat a "test obfuscation suite" (#201).

  • compare() is now documented and exported. Added a numeric method so when long numeric vectors don't match you'll see some examples of where the problem is (#177). The line spacing in compare.character() was tweaked.

  • skip_if_not_installed() skips tests if a package isn't installed (#192).

  • expect_that(a, equals(b)) style of testing has been soft-deprecated. It will keep working, but it's no longer demonstrated any where, and new expectations will only be available in expect_equal(a, b) style. (#172)

  • Once again, testthat suppresses messages and warnings in tests (#189)

  • New test_examples() lets you run package examples as tests. Each example counts as one expectation and it succeeds if the code runs without errors (#204).

  • New succeed() expectation always succeeds.

  • skip_on_travis() allows you to skip tests when run on Travis CI. (Thanks to @mllg)

  • colourise() was removed. (Colour is still supported, via the crayon package.)

  • Mocks can now access values local to the call of with_mock (#193, @krlmlr).

  • All equality expectations are now documented together (#173); all matching expectations are also documented together.

testthat 0.9.1

  • Bump R version dependency

testthat 0.9

  • BDD: testhat now comes with an initial behaviour driven development (BDD) interface. The language is similiar to RSpec for Ruby or Mocha for JavaScript. BDD tests read like sentences, so they should make it easier to understand the specification of a function. See ?describe() for further information and examples.

  • It's now possible to skip() a test with an informative message - this is useful when tests are only available under certain conditions, as when not on CRAN, or when an internet connection is available (#141).

  • skip_on_cran() allows you to skip tests when run on CRAN. To take advantage of this code, you'll need either to use devtools, or run Sys.setenv(NOT_CRAN = "true"))

  • Simple mocking: with_mock() makes it easy to temporarily replace functions defined in packages. This is useful for testing code that relies on functions that are slow, have unintended side effects or access resources that may not be available when testing (#159, @krlmlr).

  • A new expectation, expect_equal_to_reference() has been added. It tests for equality to a reference value stored in a file (#148, @jonclayden).

  • auto_test_package() works once more, and now uses devtools::load_all() for higher fidelity loading (#138, #151).

  • Bug in compare.character() fixed, as reported by Georgi Boshnakov.

  • colourise() now uses option testthat.use_colours (default: TRUE). If it is FALSE, output is not colourised (#153, @mbojan).

  • is_identical_to() only calls all.equal() to generate an informative error message if the two objects are not identical (#165).

  • safe_digest() uses a better strategy, and returns NA for directories (#138, #146).

  • Random praise is renabled by default (again!) (#164).

  • Teamcity reporter now correctly escapes output messages (#150, @windelinckx). It also uses nested suites to include test names.

  • library_if_available() has been deprecated.

testthat 0.8.1

  • Better default environment for test_check() and test_package() which allows S4 class creation in tests

  • compare.character() no longer fails when one value is missing.

testthat 0.8

testthat 0.8 comes with a new recommended structure for storing your tests. To better meet CRAN recommended practices, testthat now recommend that you to put your tests in tests/testthat, instead of inst/tests (this makes it possible for users to choose whether or not to install tests). With this new structure, you'll need to use test_check() instead of test_packages() in the test file (usually tests/testthat.R) that runs all testthat unit tests.

The other big improvement to usability comes from @kforner, who contributed code to allow the default results (i.e. those produced by SummaryReporter) to include source references so you can see exactly where failures occured.

  • MultiReporter, which combines several reporters into one. (Thanks to @kforner)

  • ListReporter, which captures all test results with their file, context, test and elapsed time. test_dir, test_file, test_package and test_check now use the ListReporter to invisibly return a summary of the tests as a data frame. (Thanks to @kforner)

  • TeamCityReporter to produce output compatible with the TeamCity continuous integration environment. (Thanks to @windelinckx)

  • SilentReporter so that testthat can test calls to test_that. (Thanks to @craigcitro, #83)

  • expect_null() and is_null to check if an object is NULL (#78)

  • expect_named() and has_names() to check the names of a vector (#79)

  • expect_more_than(), is_more_than(), expect_less_than(), is_less_than() to check values above or below a threshold. (#77, thanks to @jknowles)

  • expect_that() (and thus all expect_* functions) now invisibly return the expectation result, and stops if info or label arguments have length > 1 (thanks to @kforner)

  • fixed two bugs with source_dir(): it did not look for the source scripts at the right place, and it did not use its chdir argument.

  • When using expect_equal() to compare strings, the default output for failure provides a lot more information, which should hopefully help make finding string mismatches easier.

  • SummaryReporter has a max_reports option to limit the number of detailed failure reports to show. (Thanks to @crowding)

  • Tracebacks will now also contain information about where the functions came from (where that information is available).

  • matches and expect_match now pass additional arguments on to grepl so that you can use fixed = TRUE, perl = TRUE or ignore.case = TRUE to control details of the match. expect_match now correctly fails to match NULL. (#100)

  • expect_output, expect_message, expect_warning and expect_error also pass ... on to grepl, so that you can use fixed = TRUE, perl = TRUE or ignore.case = TRUE

  • Removed stringr and evaluate dependencies.

  • The not() function makes it possible to negate tests. For example, expect_that(f(), not(throws_error())) asserts that f() does not throw an error.

  • Make dir_state less race-y. (Thanks to @craigcitro, #80)

  • auto_test now pays attention to its 'reporter' argument (Thanks to @crowding, #81)

  • get_reporter(), set_reporter() and with_reporter() are now exported (#102)

testthat 0.7.1

  • Ignore attributes in is_true and is_false (#49)

  • make_expectation works for more types of input (#52)

  • Now works better with evaluate 0.4.3.

  • new fail() function always forces a failure in a test. Suggested by Richie Cotton (#47)

  • Added TapReporter to produce output compatible with the "test anything protocol". Contributed by Dan Keshet.

  • Fixed where auto_test would identify the wrong files as having changed. (Thanks to Peter Meilstrup)

testthat 0.7

  • SummaryReporter: still return informative messages even if no tests defined (just bare expectations). (Fixes #31)

  • Improvements to reference classes (Thanks to John Chambers)

  • Bug fixes for when nothing was generated in gives_warning / shows_message. (Thanks to Bernd Bischl)

  • New make_expectation function to programmatically generate an equality expectation. (Fixes #24)

  • SummaryReporter: You don't get praise until you have some tests.

  • Depend on methods rather than requiring it so that testthat works when run from Rscript

  • auto_test now normalises paths to enable better identification of file changes, and fixes bug in instantiating new reporter object.

testthat 0.6

  • All mutatr classes have been replaced with ReferenceClasses.

  • Better documentation for short-hand expectations.

  • test_dir and test_package gain new filter argument which allows you to restrict which tests are run.

testthat 0.5

  • bare expectations now correctly throw errors again

testthat 0.4

  • autotest correctly loads code and executes tests in same environment

  • contexts are never closed before they are opened, and always closed at the end of file

  • fixed small bug in test_dir where each test was not given its own environment

  • all expect_* short cut functions gain a label argument, thanks to Steve Lianoglou

testthat 0.3

  • all expectations now have a shortcut form, so instead of expect_that(a, is_identical_to(b)) you can do expect_identical(a, b)

  • new shows_message and gives_warning expectations to test warnings and messages

  • expect_that, equals, is_identical_to and is_equivalent to now have additional label argument which allows you to control the appearance of the text used for the expected object (for expect_that) and actual object (for all other functions) in failure messages. This is useful when you have loops that run tests as otherwise all the variable names are identical, and it's difficult to tell which iteration caused the failure.

  • executing bare tests gives nicer output

  • all expectations now give more information on failure to make it easier to track down the problem.

  • test_file and test_dir now run in code in separate environment to avoid pollution of global environment. They also temporary change the working directory so tests can use relative paths.

  • test_package makes it easier to run all tests in an installed package. Code run in this manner has access to non-exported functions and objects. If any errors or failures occur, test_package will throw an error, making it suitable for use with R CMD check.

testthat 0.2

  • colourise also works in screen terminal

  • equals expectation provides more information about failure

  • expect_that has extra info argument to allow you to pass in any extra information you'd like included in the message - this is very helpful if you're using a loop to run tests

  • is_equivalent_to: new expectation that tests for equality ignoring attributes

  • library_if_available now works! (thanks to report and fix from Felix Andrews)

  • specify larger width and join pieces back together whenever deparse used (thanks to report and fix from Felix Andrews)

  • test_dir now looks for any files starting with test (not test- as before)

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("testthat")

1.0.2 by Hadley Wickham, a year ago


https://github.com/hadley/testthat


Report a bug at https://github.com/hadley/testthat/issues


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


Authors: Hadley Wickham [aut, cre], RStudio [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports digest, crayon, praise, magrittr, R6, methods

Suggests devtools, withr, covr


Imported by BETS, CARBayesST, DBItest, DamiaNN, Phxnlme, SixSigma, arulesCBA, bedr, drake, eggCounts, googleAuthR, googleCloudStorageR, lintr, mockery, ncappc, raptr, rpostgisLT, rusda, stubthat, swirl, texmexseq, vdiffr, zoon.

Depended on by MInt, SortableHTMLTables, StableEstim, httptest, humanFormat, kergp, markmyassignment.

Suggested by ABCoptim, ADPclust, AHR, ALA4R, ANLP, APfun, ARPobservation, ARTool, AbsFilterGSEA, AlignStat, AnnotationBustR, ArgumentCheck, AutoModel, AzureML, BBmisc, BEDMatrix, BEQI2, BIEN, BTYDplus, BWStest, BatchExperiments, BatchGetSymbols, BatchJobs, BayesCombo, BayesFactor, BayesianTools, BioInstaller, BurStMisc, BuyseTest, CDVineCopulaConditional, CHNOSZ, CPBayes, CPsurv, CampaR1, Causata, CheckDigit, Ckmeans.1d.dp, ClusterR, CollapsABEL, CompareCausalNetworks, CopulaDTA, Countr, Crossover, Cyclops, CytobankAPI, DBI, DCG, DEMOVA, DEploid, DGCA, DHARMa, DSsim, DYM, Dark, DataCombine, DataExplorer, DataLoader, DeLorean, Delaporte, Deriv, DescribeDisplay, DiagrammeR, DiceKriging, DidacticBoost, DirichletReg, Distance, Dowd, DrBats, ECOSolveR, ECctmc, EDISON, EEM, EGRET, EGRETci, EML, EMMLi, EcoSimR, EnvCpt, EpiModel, FLightR, FRK, FSA, FSelectorRcpp, FTRLProximal, FastImputation, FedData, Fgmutils, FinancialInstrument, FlexDir, ForeCA, ForestTools, FunChisq, GAS, GCalignR, GDELTtools, GDINA, GERGM, GGIR, GGally, GK2011, GMCM, GSODR, GUILDS, GWLelast, GauPro, GeomComb, GerminaR, GetHFData, GetTDData, GetoptLong, GlobalOptions, Gmisc, GoodmanKruskal, Greg, GrpString, GsymPoint, HARtools, HIBPwned, HTSSIP, HydeNet, IAPWS95, IRdisplay, ISOweek, ITGM, IalsaSynthesis, IgorR, InformativeCensoring, Infusion, JOUSBoost, JSM, JWileymisc, Jdmbs, Jmisc, KFAS, KernelKnn, Kmisc, KraljicMatrix, LEANR, LLSR, LW1949, LaF, Lambda4, LambertW, LiblineaR.ACF, LinearizedSVR, LinkedMatrix, LogicOpt, Luminescence, MALDIquant, MALDIquantForeign, MFPCA, MMWRweek, MOEADr, MRMR, MScombine, MTurkR, MVN, MakefileR, MarkowitzR, Matrix.utils, MazamaSpatialUtils, MetaComp, MixSIAR, ModelMetrics, Momocs, MonetDBLite, MonoPhy, MonteCarlo, Morpho, MotilityLab, MplusAutomation, MultiBD, MultiGHQuad, NCA, NFP, NNLM, NNTbiomarker, NetRep, NetworkInference, NetworkRiskMeasures, NlsyLinks, NoiseFiltersR, OECD, OLScurve, OOBCurve, OasisR, OpenImageR, OpenML, OrthoPanels, PANICr, PCSinR, PDQutils, PKNCA, POUMM, PP, PRISMAstatement, PRROC, PTXQC, Pade, ParamHelpers, PeerPerformance, PepSAVIms, Peptides, Perc, PhylogeneticEM, PivotalR, PopED, PortfolioAnalytics, PortfolioEffectHFT, ProjectTemplate, ProteinDescriptors, QCApro, QFASA, Quandl, QuantumClone, R2admb, R4CouchDB, R6, R6Frame, RAM, RANN, RANN.L1, RAppArmor, RBPcurve, RCMIP5, RClone, RDS, RDataCanvas, RDocumentation, RDota2, REDCapR, RFc, RForcecom, RFormatter, RGA, RGoogleAnalytics, RI2by2, RImageJROI, RImagePalette, RInno, RItools, RLumModel, RMySQL, RNHANES, RNeXML, RNeo4j, RNifti, RNiftyReg, RODBCDBI, RObsDat, ROpenFIGI, RPANDA, RPresto, RQGIS, RSQLite, RSSL, RSauceLabs, RSelenium, RSentiment, RSiteCatalyst, RSocrata, RStoolbox, RTriangle, Ramble, Rborist, Rcereal, RcmdrPlugin.lfstat, RcppFaddeeva, RcppRoll, RcppShark, ReIns, RefManageR, ReliabilityTheory, ReporteRs, Rexperigen, Rfit, RiskPortfolios, Rlibeemd, RndTexExams, Rssa, Rtsne, Ruchardet, Ryacas, SDMPlay, SEMID, SHELF, SLOPE, SNSequate, SPOT, SSDM, STEPCAM, SchemaOnRead, SciencesPo, ScrabbleScore, SharpeR, SimPhe, SmartSifter, Smisc, SmithWilsonYieldCurve, SnakeCharmR, SocialMediaLab, SpaCCr, SpaDES, SparseGrid, SpecsVerification, SqlRender, StatRank, SuperLearner, SwarmSVM, SyncRNG, TFMPvalue, TSP, TSdist, TauStar, Tcomp, ThreeArmedTrials, TileManager, TimeProjection, TreeBUGS, UBL, UNF, USAboundaries, V8, VSURF, VTrack, VarReg, VennDiagram, WHO, WVPlots, Wats, WhatIf, WikidataR, WikipediR, Wmisc, WufooR, XiMpLe, Zelig, ZeligChoice, ZeligEI, ZillowR, aLFQ, aRxiv, abbyyR, abjutils, acepack, adegenet, admixturegraph, aemo, afex, ahp, aidar, alakazam, alluvial, ameco, analogsea, analogue, analogueExtra, anomalyDetection, anonymizer, aoos, apa, apaStyle, apaTables, apdesign, apex, apricom, archivist, argparse, arrApply, arsenal, arules, ashr, aslib, aspi, asremlPlus, assertive, assertive.base, assertive.code, assertive.data, assertive.data.uk, assertive.data.us, assertive.datetimes, assertive.files, assertive.matrices, assertive.models, assertive.numbers, assertive.properties, assertive.reflection, assertive.sets, assertive.strings, assertive.types, assertr, assertthat, attrCUSUM, attribrisk, autoimage, automultinomial, autothresholdr, autovarCore, aws.alexa, aws.signature, aws.sqs, awsjavasdk, backShift, backpipe, backtestGraphics, badgecreatr, bagRboostR, base64url, batchtools, batman, bayesAB, bayesDP, bayesGDS, bayesbio, bayesboot, bayesplot, bazar, bbmle, bdscale, benchmarkme, benchmarkmeData, benchr, benford.analysis, betalink, bfork, bgmfiles, bgmm, bibliospec, biglasso, bigmemory, bigrquery, bigstep, binaryLogic, bindr, bindrcpp, binman, binomSamSize, binomen, binst, bio3d, bioOED, biogas, biogram, bioinactivation, biolink, biomartr, biomod2, biotic, birdnik, biwavelet, blackbox, blme, blob, blscrapeR, bmp, bnnSurvival, bnstruct, bold, bootLR, bossMaps, boxr, bpa, bridgedist, bridger2, bridgesampling, brms, broman, broom, brr, brranching, bsplus, bunchr, burnr, callr, camsRad, canvasXpress, captr, caret, caretEnsemble, carpenter, causaldrf, ccafs, ccdrAlgorithm, cda, cdcfluview, cellranger, censys, cgdsr, changepoint, checkmate, checkpoint, chopthin, chords, choroplethr, chromer, chunked, citr, cjoint, ckanr, clarifai, classifierplots, cleanEHR, cleangeo, climbeR, climwin, clipr, clisymbols, clubSandwich, clust.bin.pair, clusterSim, clusterhap, clusternomics, cmaesr, cmna, coRanking, coala, cocor, cocorresp, cocron, codyn, coefplot, coenocliner, cointReg, colf, collUtils, collapsibleTree, colormap, colorplaner, colourlovers, colourvision, combiter, commentr, compareDF, concatenate, condformat, conditions, condvis, confidence, config, configr, confinterpret, convertr, convey, coreSim, corehunter, corrgram, corrplot, corrr, corset, couchDB, countrycode, covr, cowsay, cpr, crandatapkgs, crayon, creditr, cronR, crtests, crul, csvy, ctsem, cubature, curl, cvequality, cyclocomp, cymruservices, d3r, daff, dagitty, dams, darch, darksky, dat, data.table, data.tree, dataRetrieval, datacheckr, datadr, dataonderivatives, dataone, datapack, datapasta, datarobot, datastepr, dbarts, dbfaker, dbhydroR, dbmss, dbscan, dcemriS4, dcmr, ddR, ddpcr, deBInfer, debugme, decisionSupport, decoder, decompr, deductive, deepboost, dendextend, dendroextras, densityClust, desc, describer, descriptr, detector, devRate, devtools, df2json, dggridR, diagis, diagonals, diffobj, diffrprojects, diffrprojectswidget, diffusr, digitize, dils, dimRed, discgolf, discreteRV, discretecdAlgorithm, disparityfilter, disposables, distances, divest, dml, docopt, docopulae, doctr, docxtractr, domino, dostats, dotCall64, downloader, downsize, dplR, dplyr, dpmr, drLumi, drsmooth, dtplyr, dtwSat, dtwclust, dygraphs, dynRB, dynamichazard, dynetNLAResistance, dynr, eHOF, earthtones, easyVerification, easyformatr, ecb, ecd, ecoengine, ecr, edarf, edfReader, eechidna, eemR, eeptools, effsize, elastic, elasticsearchr, elementR, elevatr, emdbook, emdi, emil, emuR, enigma, enrichwith, ensurer, entropart, epidata, episensr, eply, errorlocate, esaddle, esmisc, estatapi, etl, etrunct, etseed, eulerr, europepmc, eurostat, evaluate, evaluator, evolqg, evoper, exact2x2, exampletestr, excursions, exif, explor, exprso, extdplyr, extraDistr, extraTrees, extremeStat, eyelinker, eyetrackingR, ezec, ezknitr, ezsummary, fail, fakeR, fanovaGraph, farff, fastAdaboost, fastcmh, fauxpas, fbar, fdapace, feather, fecR, feedeR, ffbase, ffstream, fiery, fiftystater, filenamer, filesstrings, finch, findpython, findviews, finreportr, fitcoach, fitplc, flacco, flexdashboard, flexsurv, flifo, flora, flowr, flsa, fmbasics, fmdates, foghorn, fontquiver, forcats, forecast, forecastHybrid, forecastSNSTS, forestplot, formattable, formula.tools, fpCompare, frair, franc, freqweights, fromo, fst, fulltext, funData, functools, funr, funrar, furniture, futile.any, futile.logger, futureheatwaves, fuzzr, fuzzyjoin, gWidgets2RGtk2, gWidgets2tcltk, games, gapfill, gapminder, gasfluxes, gatepoints, gbp, gbts, gdns, gdtools, gear, geeM, gemtc, gender, genderizeR, geneSLOPE, generator, genie, geoSpectral, geoaxe, geohash, geojson, geojsonR, geojsonio, geojsonlint, geoknife, geometry, geoparser, geosapi, geozoo, gesis, getCRUCLdata, getlandsat, getopt, ggRandomForests, ggalt, ggdendro, ggfortify, ggghost, ggguitar, gghalfnorm, ggiraphExtra, ggloop, ggnetwork, ggplot2, ggseas, ggstance, ggswissmaps, ggthemes, ggvis, ghit, gistr, githubinstall, gitlabr, givitiR, gk, glcm, glm.ddR, glmmTMB, glmmsr, glycanr, gmailr, gmum.r, gmwm, gofastr, gogamer, googleAnalyticsR, googleComputeEngineR, googleformr, googlesheets, googleway, gower, gpuR, graphTweets, graphql, graticule, grattan, gridExtra, gridsampler, groupdata2, growcurves, growfunctions, growthcurver, grpSLOPE, grpregOverlap, gsheet, gsrc, gt4ireval, gtable, guess, gutenbergr, gvc, gwdegree, gym, h5, hNMF, hail, hansard, haplotyper, harvestr, hash, hashids, hashmap, hashr, haven, hddtools, hdm, healthcareai, heemod, hellno, heuristica, highlightHTML, hisse, hit, hitandrun, hms, homeR, hrbrthemes, htmlTable, htmltab, htmltidy, htmltools, hts, httping, httr, humaniformat, hunspell, huxtable, hybridEnsemble, hydrogeo, hyperSpec, hyphenatr, hypoparsr, hypothesisr, iNEXT, ibmcraftr, ibr, icarus, icd, icd9, icensmis, icesDatras, icesSAG, icesVocab, ids, ifaTools, ifctools, imager, imputeMulti, imputeR, imputeTS, inbreedR, incadata, incidence, indelmiss, inferference, inferr, influenceR, infuser, injectoR, inlmisc, inpdfr, intercure, intergraph, internetarchive, investr, io, iotools, ipdw, iprior, iptools, iqspr, isdparser, iterpc, itertools2, jaatha, james.analysis, janeaustenr, janitor, jiebaR, jmotif, jmv, jmvcore, joineR, joineRML, jose, jpmesh, jqr, jsonlite, jsonvalidate, jtools, jug, junr, jwutil, kableExtra, kamila, kantorovich, kdecopula, kelvin, kimisc, kmeans.ddR, kmodR, knitcitations, knitrBootstrap, knockoff, kntnr, koRpus, kokudosuuchi, kriens, kselection, labelled, lamW, lambda.tools, largeList, largeVis, lasvmR, latex2exp, lava, lavaan, lavaan.survey, lawn, lazyWeave, lazyeval, lazyrmd, lazysql, ldamatch, leaflet, learNN, learningCurve, letsR, lettercase, lexRankr, lfactors, lfda, lfl, lfstat, lidR, lifecontingencies, lightsout, lineup, lingtypology, lintools, liqueueR, liquidSVM, list, listWithDefaults, liteq, llama, lmPerm, lme4, lmem.gwaser, lmem.qtler, lmeresampler, lmvar, log4r, logisticPCA, longpower, longurl, loo, lookupTable, lowmemtkmeans, lplyr, lrequire, lsbclust, ltmle, lubridate, lucid, lucr, lumendb, luzlogr, mHG, macleish, madness, mads, mafs, magicfor, magrittr, manifestoR, mapr, margins, marinespeed, markophylo, markovchain, mason, matchMulti, matchingR, matconv, mbbefd, mbest, mboost, mcIRT, mcglm, mcmcse, mco, mcparallelDo, mdftracks, mdsOpt, medicalrisk, medicare, memo, memoise, merTools, metacoder, metacom, metafor, metagear, metaheur, meteR, metricTester, metricsgraphics, mets, mfe, mgarchBEKK, micompr, midasr, milr, miniCRAN, minimap, mizer, mkin, mlr, mlrMBO, mlsjunkgen, mmand, mmod, mmpf, modelr, modeval, modules, moezipfR, moko, monkeylearn, moonBook, morgenstemning, morse, mosaic, mousetrap, move, moveHMM, moveWindSpeed, mpoly, mrds, mregions, mrgsolve, mscstexta4r, mscsweblm4r, msgtools, msm, msmtools, mtconnectR, mudata, multdyn, multiCA, multifwf, multilevelPSA, multiplyr, munsell, mvnfast, mvtboost, mwaved, myTAI, mycor, nLTT, nabor, naptime, narray, nat, nat.nblast, nat.templatebrains, nat.utils, natserv, naturalsort, nbc4va, ndjson, ndtv, needy, neighbr, neotoma, nestedRanksTest, netdiffuseR, netgen, network, networkDynamic, networkreporting, neurobase, neuroim, ngramrr, nima, nimble, nlmeU, nloptr, nlstimedist, nodiv, noncompliance, nonnest2, normalr, nscancor, nse, nsprcomp, nzelect, oai, obAnalytics, observer, oce, odbc, oddsratio, odeintr, officer, olctools, omics, openadds, opencage, openssl, openxlsx, opera, operator.tools, operators, optiRum, optigrab, optimus, optmatch, optparse, ordinal, ordinalNet, ore, ores, originr, oro.dicom, oro.nifti, osc, osi, osmplotr, outbreaks, outreg, owmr, pROC, packagedocs, packrat, pacman, paco, pacotest, padr, pageviews, paleobioDB, paleomorph, palm, palr, pals, pangaear, papeR, parallelMap, params, parsedate, parsemsf, pathological, pavo, pbo, pdSpecEst, pdfsearch, pdp, permGS, permute, phangorn, phonenumber, phonics, photobiology, photobiologyInOut, phrasemachine, phyloTop, phylobase, phylolm, phylometrics, phyndr, physiology, pim, pingr, pipeR, pipefittr, pipeliner, pitchRx, pivottabler, pixiedust, pkgconfig, pkgmaker, plac, planar, plantecophys, plater, platetools, pleiades, plotROC, plotluck, plotly, plotwidgets, plspm, pltesim, plumber, plumbr, plyr, pmc, pmfdR, pmml, pmmlTransformations, pnn, poio, pollen, polyCub, pop, popEpi, popgraph, poplite, poppr, popprxl, postGIStools, poweRlaw, powerbydesign, praise, prcbench, preText, precrec, predatory, prediction, prefeR, prepdat, preprocomb, preproviz, prereg, prettycode, prettyunits, primefactr, primes, prioritylasso, prism, prodigenr, productplots, prof.tree, profilr, profvis, progress, prophet, propr, proto, protoclass, protolite, pryr, psd, pseval, psidR, ptstem, pubprint, pulsar, purge, purrr, pvar, pwrRasch, pxweb, pystr, qap, qdap, qdapRegex, qdapTools, qfasar, qiimer, qiitr, qrencoder, qtl, qtlcharts, quadrupen, qualpalr, quanteda, quantspec, questionr, queuecomputer, quhomology, quickmapr, qwraps2, r2glmm, rAltmetric, rAmCharts, rAvis, rClinicalCodes, rDEA, rEMM, rGoodData, rGroovy, rKIN, rLDCP, rLakeAnalyzer, rPref, rUnemploymentData, rYoutheria, radarchart, radiant, radiant.basics, radiant.data, radiant.design, radiant.model, radiant.multivariate, radiomics, radmixture, rags2ridges, ragtop, rakeR, ramcmc, ramify, randNames, randgeo, randomForest.ddR, randomizeR, randomizr, rangeMapper, ranger, rankdist, rapiclient, rappdirs, ratelimitr, ratesci, rbcb, rbgm, rbhl, rbi, rbison, rbokeh, rbundler, rcanvec, rcbalance, rcbsubset, rccdates, rccmisc, rclimateca, rclinicaltrials, rcmdcheck, rcrossref, rcrypt, rdatacite, rddtools, rdefra, rdian, rdist, rdomains, rdpla, rdrop2, rdryad, rdwd, readODS, readability, readbitmap, readr, readstata13, readxl, rebird, rebus, rebus.base, rebus.datetimes, rebus.numbers, recexcavAAR, recmap, recommenderlab, reconstructr, redist, redland, refimpact, refnr, refset, regexr, reinstallr, rematch, remotes, rentrez, repijson, replyr, reportr, repr, represtools, reprex, request, rerddap, reshape2, restimizeapi, restrictedMVN, resumer, rethinker, reticulate, retistruct, reutils, revealjs, rex, rfigshare, rfishbase, rfml, rgbif, rgeolocate, rgeos, rgho, rglobi, rhoR, riceware, ridigbio, riem, rif, rinat, rintrojs, rio, riskRegression, ritis, riverdist, rjsonapi, rjstat, rlist, rly, rmapshaper, rmarkdown, rmumps, rnaturalearth, rnaturalearthdata, rnbn, rncl, rnetcarto, rnn, rnoaa, rnpn, rnrfa, roahd, robotstxt, rodham, rollply, rolr, rolypoly, ropenaq, rorcid, rorutadis, rosetteApi, rotations, rotl, roxygen2, rpartitions, rpcdsearch, rpdo, rpf, rpivotTable, rplos, rpn, rpnf, rprev, rprime, rprintf, rprojroot, rpsftm, rptR, rpubchem, rr, rredlist, rrr, rscimark, rsconnect, rscopus, rscorecard, rsdmx, rsig, rslp, rslurm, rsnps, rspa, rsparkling, rstack, rstackdeque, rstanarm, rstantools, rstudioapi, rsunlight, rsvd, rt3, rtdists, rtext, rticles, rtide, rtimes, rtk, rtrie, rtrim, rtson, rtweet, rtype, rtypeform, rucrdtw, runittotestthat, rust, rvertnet, rvest, rvg, rvgtest, rwars, rwirelesscom, sBIC, sValues, sadists, saeRobust, saeSim, sankey, satellite, sbart, sbtools, scales, scanstatistics, scclust, scdhlm, scorer, scoring, scphaser, scrm, scrubr, sdcMicro, sdcTable, sdmpredictors, sdmvspecies, searchable, segmag, selectr, seleniumPipes, semver, sensR, sentimentr, seqMeta, seqminer, sequences, seriation, seroincidence, setter, settings, sf, sfinx, sgd, shades, shadow, shazam, shiny, shinyAce, shinyRGL, shinyShortcut, shinyTree, shinyjs, shinystan, sigmoid, sigr, simmer, simmer.plot, simplegraph, simplr, simputation, simr, simstudy, simulator, sisal, skeletor, slackr, slim, smacpod, smapr, smcUtils, smerc, smoof, smooth, smoothAPC, sofa, solr, solrium, sortinghat, sorvi, sourcetools, sp500SlidingWindow, spaMM, spaero, spareserver, spark, sparklyr, sparseHessianFD, sparseMVN, sparsebn, sparsebnUtils, sparsevar, spatialprobit, spbabel, spcadjust, spdplyr, spduration, spdynmod, sperrorest, spex, spiders, splines2, spocc, sqlscore, squid, srvyr, sspse, sss, stR, stablespec, stabs, starmie, statar, statebins, stationaRy, statip, statisticalModeling, statsgrokse, stcov, sticky, stlplus, stm, stmgui, storr, stplanr, strat, stream, stressr, stringb, stringdist, stringr, strip, strvalidator, subprocess, summariser, superheat, supervisedPRIM, surveillance, surveybootstrap, svd, svglite, svyPVpack, sweidnumbr, swirlify, syllable, synthACS, sys, systemicrisk, syuzhet, tableHTML, tableone, tadaatoolbox, taskscheduleR, taxize, taxonomizr, tbdiag, teda, templates, tensorflow, tester, texmex, text2vec, textTinyR, textclean, textgRid, textmining, textreadr, textreg, textreuse, textshape, textstem, threewords, tibble, tictactoe, tidyRSS, tidyjson, tidyquant, tidyr, tidytext, tidyxl, tigger, tigris, tikzDevice, timevis, tinsel, tm.plugin.webmining, tmod, toOrdinal, toaster, tokenizers, tourr, toxboot, tracer, trackeR, traitr, traits, treatSens, treebase, treeclim, treeman, treescape, treespace, trelliscope, triebeard, trip, trustOptim, tsPI, tsna, tspmeta, tuber, tuckerR.mmgg, tufterhandout, tumgr, turner, tutorial, tvm, twilio, uaparserjs, ubeR, udapi, umx, ungeneanno, uniqtag, unitedR, units, unpivotr, uptimeRobot, urlshorteneR, urltools, useful, usmap, utiml, valaddin, validate, validatejsonr, valr, valuer, varbvs, varian, vcfR, vdmR, vegalite, vegdata, vembedr, vietnamcode, vines, vipor, viridis, viridisLite, virustotal, vortexR, vtreat, waffle, wakefield, walkr, wand, waver, wdman, weatherData, webchem, webreadr, webuse, wellknown, wgsea, whoami, whoapi, wicket, wikilake, wikipediatrend, withr, wkb, worrms, wppExplorer, wrapr, wrassp, wrswoR, xgboost, xlutils3, xml2, xmlparsedata, xoi, xslt, xtractomatic, yCrypticRNAs, yakmoR, yaml, yesno, yummlyr, zeallot, zoom, ztable.


See at CRAN