download: Download file from browndog

Description Usage Arguments Value Examples

View source: R/download.R

Description

This will download a file, if a 404 is returned it will wait until the file is available. If the file is still not available after timeout tries, it will return NA. If the file is downloaded it will return the name of the file

Usage

1
download(url, file, token, timeout = 60)

Arguments

url

the url of the file to download

file

the filename

token

Brown Dog access token

timeout

timeout number of seconds to wait for file (default 60)

Value

the name of file if successfull or NA if not.

Examples

1
2
3
4
5
6
## Not run: 
key <- get_key("https://bd-api-dev.ncsa.illinois.edu", "your email", "password")
token <- get_token("https://bd-api-dev.ncsa.illinois.edu", key)
download("https://bd-api-dev.ncsa.illinois.edu", "vdc.csv", token)

## End(Not run)

NCSABrownDog/bd.r documentation built on May 7, 2019, 6:01 p.m.