fc_download_data: Download a data file from a remote location

View source: R/loading.R

fc_download_dataR Documentation

Download a data file from a remote location

Description

By default this function will check for an up to date local version of the remote file using the download.file.wcheck function.

Usage

fc_download_data(
  url,
  type = c("data", "db", "bigmat", "ff"),
  overwrite = getOption("flycircuit.remote_overwrite"),
  ...
)

Arguments

url

the location of the remote file.

type

the type of file (data, db, or bigmat).

overwrite

whether to overwrite an existing file. If NULL (the default package option), the HTTP headers are inspected to see if the remote version is newer than the local version and only downloads the remote version if this is so.

...

additional arguments passed to download.file (e.g. quiet).

Details

The default value for the overwrite argument can be changed by setting options('flycircuit.remote_overwrite') to TRUE or FALSE. Setting this to FALSE may be useful if checking the headers of the remote files takes too long.

Value

The path to the downloaded file.

See Also

download.file.wcheck

Examples

## Not run: 
fc_download_data("http://myurl.com/data", quiet=TRUE)
fc_download_data("http://myurl.com/data.ff", type='ff')

fc_download_data("http://myurl.com/data.desc", type='bigmat')

## End(Not run)

jefferis/flycircuit documentation built on Feb. 4, 2023, 6:04 p.m.