NOTE: This should be used primarily as a fallback mechanism! EarthData Cloud resources are often best accessed directly over HTTPS without download. This allows subsets to be extracted instead of downloading unnecessary bits. Unfortunately, certain formats do not support such HTTP-based range requests (e.g. HDF4), and require the asset is downloaded to a local POSIX filesystem first.
edl_download(
href,
dest = basename(href),
auth = "netrc",
method = "curl",
username = default("user"),
password = default("password"),
netrc_path = edl_netrc_path(),
cookie_path = edl_cookie_path(),
quiet = TRUE,
...
)the dest path, invisibly
the https URL of the asset
local destination
the authentication method ("token" for Bearer tokens or "netrc" for netrc.)
The download method, either "httr" or "curl".
EarthData Login User
EarthData Login Password
Path to the .netrc file to be created. Defaults to the
appropriate R package configuration location given by tools::R_user_dir().
Path to the file where cookies will be stored. Defaults
to the appropriate R package configuration location given by
tools::R_user_dir().
logical default TRUE. Show progress in download?
additional arguments to download.file(), e.g. quiet = TRUE.
if (FALSE) { # interactive()
href <- lpdacc_example_url()
edl_download(href)
}
Run the code above in your browser using DataLab