queryRCmdCheck

0th

Percentile

Gets the on R CMD check if the current R session was launched by it

Gets the on R CMD check if the current R session was launched by it.

Usage
queryRCmdCheck(...)
Arguments
...
Not used.
Value

  • Returns character string "checkingTests" if 'R CMD check' runs one one of the package tests, and "checkingExamples" if it runs one of the package examples. If the current R session was not launched by 'R CMD check', then "notRunning" is returned.

Limitations

This function only works if the working directory has not been changed.

Aliases
  • queryRCmdCheck
Examples
status <- queryRCmdCheck()
if (status != "notRunning") {
  cat("The current R session was launched by R CMD check. Status: ", status, "")
} else {
  cat("The current R session was not launched by R CMD check.
")
}

# Display how R was launched
print(base::commandArgs())

# Display loaded packages etc.
print(search())

# Display current working directory
print(getwd())
Documentation reproduced from package R.utils, version 1.28.4, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.