Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

downloadfile

Download files and check their binary integrity


Description

This function is the internal function used in IsoriX to download the large files from internet and it could be useful to download anything from within R. We created this function to make sure that the downloaded files are valid. Downloads can indeed result in files that are corrupted, so we tweaked the options to reduce this possibility and the function runs a check if the signature of the file is provided to the argument md5sum.

Usage

downloadfile(
  address = NULL,
  filename = NULL,
  path = NULL,
  overwrite = FALSE,
  md5sum = NULL,
  verbose = interactive()
)

Arguments

address

A string indicating the address of the file on internet

filename

A string indicating the name under which the file must be stored

path

A string indicating where to store the file on the hard drive (without the file name!)

overwrite

A logical indicating if an existing file should be re-downloaded

md5sum

A string indicating the md5 signature of the valid file as created with tools::md5sum()

verbose

A logical indicating whether information about the progress of the procedure should be displayed or not while the function is running. By default verbose is TRUE if users use an interactive R session and FALSE otherwise. If a numeric is provided instead, additional information about the download will be provided if the number is greater than 1.

Value

The complete path of the downloaded file (invisibly)

Note

Users should directly use the function getelev() and getprecip().

See Also


IsoriX

Isoscape Computation and Inference of Spatial Origins using Mixed Models

v0.8.2
GPL (>= 2)
Authors
Alexandre Courtiol [aut, cre] (<https://orcid.org/0000-0003-0637-2959>), François Rousset [aut] (<https://orcid.org/0000-0003-4670-0371>), Marie-Sophie Rohwaeder [aut], Stephanie Kramer-Schadt [aut] (<https://orcid.org/0000-0002-9269-4446>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.