| .openland_try_download_and_load_rda | R Documentation |
Internal helper to download a remote '.rda' file (e.g., from Zenodo), load it into an environment, and return a single 'TRUE/FALSE' indicating whether the dataset is available.
.openland_try_download_and_load_rda(
url,
object = NULL,
envir = parent.frame(),
timeout = 10,
cache = TRUE,
cache_dir = NULL,
quiet = TRUE
)
url |
character. Remote '.rda' URL. |
object |
character or NULL. If provided, requires that this object name exists inside the '.rda' file; otherwise returns 'FALSE'. |
envir |
environment. Environment where the objects from the '.rda' file will be loaded. |
timeout |
integer. Download timeout (seconds) set via 'options(timeout)'. |
cache |
logical. Whether to cache the downloaded file. |
cache_dir |
character or NULL. Cache directory used only when 'cache = TRUE'. When 'NULL', uses 'tools::R_user_dir("OpenLand", which = "cache")' when available. |
quiet |
logical. Passed to 'utils::download.file()'. |
The function is defensive by design: it should not error if the remote host is unavailable, if the download fails, or if the '.rda' cannot be loaded. It can optionally cache the downloaded file in a persistent user cache directory. When 'cache = FALSE', the file is downloaded to a temporary path and removed at the end of the call.
logical. 'TRUE' if the '.rda' was successfully downloaded (or found in cache) and loaded into 'envir'; 'FALSE' otherwise.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.