If you would like to use dittodb in your package, and you are already using testthat, use this function to add dittodb to Suggests in the package DESCRIPTION and loads it in tests/testthat/helper.R. Call it once when you're setting up a new package test suite.

use_dittodb(path = ".")



character path to the package


Nothing: called for file system side effects.


This function should be called with the path to your package source as the path argument. The function is idempotent: if dittodb is already added to these files, no additional changes will be made.

It will:

  • add dittodb to the Suggests field of the DESCRIPTION file in the current working directory

  • add library(dittodb) to the file tests/testthat/helper.R (creating it if it doesn't already exist)


if (FALSE) { use_dittodb() use_dittodb("/path/to/package") }