This function enables to download datasets. In a data import workflow, this function is typically used after a call to the odr_get_url function. The output value of odr_get_url can be used as input of parameter df_to_dl of odr_download_data.

The download can the parallelized.

odr_download_data(df_to_dl, parallel = FALSE, credentials = NULL,
  source = NULL, verbose = TRUE)

Arguments

df_to_dl

data.frame. Urls and destination files of dataset to download. Typically output of odr_get_url. See Details for the structure

parallel

boolean. Parallelize the download ? Default to FALSE

credentials

vector string of length 2 with username and password. optional.

source

source. See details

verbose

boolean. optional. Verbose (default TRUE)

Value

a data.frame with the same structure of the input data.frame df_to_dl + columns providing details of the data downloaded. The additional columns are :

fileDl

Booloean (dataset downloaded or failure)

dlStatus

Download status : 1 = download ok ; 2 = download error ; 3 = dataset was already existing in destination file

fileSize

File size on disk

Details

Parameter df_to_dl must a data.frame with the following minimal structure :

url

URL of the source file (character string)

destfile

Destination file (character string)

Parameter source takes NULL as default value. Options are :

  • NULL : when no odr_login is required to download the data.

  • "earthdata" : to download data requiring a odr_login to EOSDIS Earthdata. To create an account go to : https://urs.earthdata.nasa.gov/