download_smap: Download SMAP data

Description Usage Arguments Details Value Examples

View source: R/download_smap.R

Description

This function downloads SMAP data in HDF5 format.

Usage

1
2
download_smap(files, directory = NULL, overwrite = TRUE,
  verbose = TRUE)

Arguments

files

A data.frame produced by find_smap() that specifies data files to download.

directory

A local directory path in which to save data, specified as a character string. If left as NULL, data are stored in a user's cache directory.

overwrite

TRUE or FALSE: should existing data files be overwritten?

verbose

TRUE or FALSE: should messages be printed to indicate that files are being downloaded?

Details

This function requires a username and password from NASA's Earthdata portal. If you have an Earthdata username and password, pass them in using the set_smap_credentials() function.

If you do not yet have a username and password, register for one here: https://urs.earthdata.nasa.gov/

Value

Returns a data.frame that appends a column called local_dir to the input data frame, which consists of a character vector specifying the local directory containing the downloaded files.

Examples

1
2
3
4
5
6
## Not run: 
files <- find_smap(id = "SPL4SMGP", dates = "2015-03-31", version = 3)
# files[1, ] refers to the first available data file
downloads <- download_smap(files[1, ])

## End(Not run)

earthlab/smapr documentation built on Dec. 22, 2018, 4:13 p.m.