% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generalfunctions.R
\name{.openland_try_download_and_load_rda}
\alias{.openland_try_download_and_load_rda}
\title{Download and load a remote .rda dataset (graceful)}
\usage{
.openland_try_download_and_load_rda(
  url,
  object = NULL,
  envir = parent.frame(),
  timeout = 10,
  cache = TRUE,
  cache_dir = NULL,
  quiet = TRUE
)
}
\arguments{
\item{url}{character. Remote `.rda` URL.}

\item{object}{character or NULL. If provided, requires that this object name
exists inside the `.rda` file; otherwise returns `FALSE`.}

\item{envir}{environment. Environment where the objects from the `.rda` file
will be loaded.}

\item{timeout}{integer. Download timeout (seconds) set via `options(timeout)`.}

\item{cache}{logical. Whether to cache the downloaded file.}

\item{cache_dir}{character or NULL. Cache directory used only when
`cache = TRUE`. When `NULL`, uses `tools::R_user_dir("OpenLand",
which = "cache")` when available.}

\item{quiet}{logical. Passed to `utils::download.file()`.}
}
\value{
logical. `TRUE` if the `.rda` was successfully downloaded (or found
  in cache) and loaded into `envir`; `FALSE` otherwise.
}
\description{
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.
}
\details{
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.
}
\keyword{internal}
