Learn R Programming

R.utils (version 2.12.3)

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

Description

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

Usage

queryRCmdCheck(...)

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.

Arguments

...

Not used.

Limitations

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

Author

Henrik Bengtsson

Examples

Run this code

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

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

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

# Display current working directory
print(getwd())

Run the code above in your browser using DataLab