From 5eb372452d848774d7d12c61fb286c459c9b0e1e Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Wed, 30 Oct 2024 08:16:02 +0800 Subject: [PATCH] only run examples if interactive --- R/get_smips.R | 4 +++- man/get_smips.Rd | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/get_smips.R b/R/get_smips.R index 6896540..db506c2 100644 --- a/R/get_smips.R +++ b/R/get_smips.R @@ -21,7 +21,9 @@ #' nothing is provided, you will be prompted on how to set up your \R session #' so that it is auto-detected and a browswer window will open at the #' \acronym{TERN} website for you to request a key. -#' @examples +#' +#' @examplesIf interactive() +#' #' r <- get_smips(day = "2024-01-01") #' #' # terra::plot() is re-exported for convenience diff --git a/man/get_smips.Rd b/man/get_smips.Rd index da0301f..eba10c0 100644 --- a/man/get_smips.Rd +++ b/man/get_smips.Rd @@ -38,11 +38,13 @@ A \link[terra:rast]{terra::rast} object Soil Moisture Integration and Prediction System (\acronym{SMIPS}) v1.0. } \examples{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} + r <- get_smips(day = "2024-01-01") # terra::plot() is re-exported for convenience plot(r) - +\dontshow{\}) # examplesIf} } \references{ \url{https://portal.tern.org.au/metadata/TERN/d1995ee8-53f0-4a7d-91c2-ad5e4a23e5e0https://geonetwork.tern.org.au/geonetwork/srv/eng/catalog.search#/metadata/d1995ee8-53f0-4a7d-91c2-ad5e4a23e5e0}