check_download_data: Check and Download Example Dataset

View source: R/gen-functions.R

check_download_dataR Documentation

Check and Download Example Dataset

Description

Checks if the example dataset is present. If not, the example dataset is downloaded.

Usage

check_download_data(
  where,
  data_source,
  force_download = FALSE,
  dsname = "flowdex_examples"
)

Arguments

where

Character length one. The path where the example dataset should be looked for.

data_source

The path to the remote .zip file.

force_download

Logical. If data should be downloaded anyway. Defaults to FALSE.

dsname

Character length one. The name of the folder containing the data. Defaults to 'flowdex_examples'.

Details

Intended to be used within the examples; is downloading and unzipping the folder 'dsname' in the folder specified at argument 'where'.

Value

Logical. FALSE if the remote .zip file was downloaded, TRUE if the example dataset was present and no download was necessary.

Examples

td <- tempdir()
data_source <- "https://github.com/bpollner/data/raw/main/flowdex_examples/flowdex_examples.zip"
check_download_data(td, data_source)

bpollner/flowdex documentation built on March 31, 2022, 3:21 a.m.