This sets environment variables, R options and library paths to work interactively on the touchstone_script.

activate(
  head_branch = gert::git_branch(),
  base_branch = getOption("touchstone.default_base_branch", "main"),
  n = 1,
  env = parent.frame()
)

deactivate(env = parent.frame())

Arguments

head_branch

Git branch to be used as the GITHUB_HEAD_REF branch (i.e. the branch with new changes) when running benchmarks. Defaults to the current branch.

base_branch

Git branch for the GITHUB_BASE_REF (i.e. the branch you want to merge your changes into) when running benchmarks. Defaults to 'main' if the option touchstone.default_base_branchis not set.

n

Number of times benchmarks should be run for each branch. Will override n argument in all interactive calls to benchmark_run().

env

In which environment the temporary changes should be made. For use within functions.

Functions

  • deactivate(): Restore the original environment state.

Examples

if (FALSE) { # \dontrun{
activate()
# You can now test parts of your touchstone script, e.g. touchstone/script.R
deactivate()
} # }