Skip to contents

Downloads large datasets from GitHub releases to avoid CRAN size limits. Supports multiple download mirrors for users in different regions. Data is cached locally after first download. Cache directory can be customized via `options(IOBR.cache_dir = "your/path")`.

Usage

download_iobr_data(
  name,
  force = FALSE,
  verbose = TRUE,
  mirrors = get_default_mirrors(),
  cache_dir = NULL
)

Arguments

name

Character string. Name of the dataset to download.

force

Logical. Whether to force re-download even if cached. Default: FALSE.

verbose

Logical. Whether to print progress messages. Default: TRUE.

mirrors

Character vector. URLs of mirrors to try. Default uses get_default_mirrors().

cache_dir

Character string. Custom cache directory. If NULL, uses the option `IOBR.cache_dir` or the default system cache location.

Value

The requested dataset.

Examples

# \donttest{
# Download TCGA STAD signature data
tcga_sig <- download_iobr_data("tcga_stad_sig")
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "tcga_stad_sig"

# Download with custom mirrors
eset <- download_iobr_data("eset_stad",
  mirrors = c(
    "https://ghproxy.vip/https://github.com",
    "https://gh-proxy.org/https://github.com"
  )
)
#>  Loading cached data: "eset_stad"

# Use custom cache directory (use tempdir() for examples)
options(IOBR.cache_dir = tempdir())
data <- download_iobr_data("lm22")
#>  Trying mirror 1/4: <https://github.com>
#>  Download complete: "lm22"
# }