RMI-PACTA / resources

This is a place to explore and share resources. Check out the "Issues".
https://rmi-pacta.github.io/resources/
17 stars 5 forks source link

Environment variables useful for package development #298

Open maurolepore opened 2 years ago

maurolepore commented 2 years ago
is_testing <- function() {
  identical(Sys.getenv("TESTTHAT"), "true")
}
skip_if_R_CMD_check <- function() {
  if (!nzchar(Sys.getenv("R_CMD"))) {
    return(invisible(TRUE))
  }

  skip("Not run in R CMD check")
}
AlexAxthelm commented 6 months ago

Worth noting that the default GH Action for running R CMD CHECK (r-libs) uses rcmdcheck::rcmdcheck, which appears to still trigger the is_testing function stubbed above.