on_cran | R Documentation |
This function detects whether the current R environment is a
CRAN machine or not. It returns FALSE
if the NOT_CRAN
environment
variable used in "github/r-lib" packages like devtools and
testthat is set to "true". If that variable is not set, the function
examines other environment variables typically set on CRAN machines, as
documented in the issue on this packages' GitHub repository at
https://github.com/briandconnelly/ami/issues/14.
on_cran(cran_pattern = "_R_", n_cran_envvars = 5L)
cran_pattern |
String to match against environment variables. |
n_cran_envvars |
If at least this number of environment variables match
the |
A logical value
on_cran()
withr::with_envvar(
list("NOT_CRAN" = "false", "_R_1" = 1, "_R_2" = 2),
on_cran(n_cran_envvars = 2L)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.