Learn R Programming

gimms (version 0.2.0)

downloadGimms: Download GIMMS 3G data

Description

Download GIMMS 3G binary data for a given time span from NASA FTP server (http://ecocast.arc.nasa.gov/data/pub/gimms/3g.v0/).

Usage

## S3 method for class 'numeric':
downloadGimms(x, y, dsn = getwd(), overwrite = FALSE,
  quiet = TRUE, mode = "wb", ...)

## S3 method for class 'character': downloadGimms(x, dsn = getwd(), overwrite = FALSE, quiet = TRUE, mode = "wb", ...)

## S3 method for class 'missing': downloadGimms(dsn = getwd(), overwrite = FALSE, quiet = TRUE, mode = "wb", ...)

Arguments

x
If 'numeric', start year for download (e.g. 2000). If 'character', a vector of full online filepath(s) to download, typically returned from updateInventory. If not supplied, download will start from
y
'numeric'. End year for download. If not supplied, download will stop at the last year available.
dsn
'character'. Destination folder for file download. If not supplied, all downloaded files will be stored in the current working directory.
overwrite
Logical. If TRUE, already downloaded files in 'dsn' will be overwritten.
quiet
Logical. If TRUE, information sent to the console is reduced.
mode
...
Further arguments passed on to download.file, e.g. 'method'.

Value

  • A vector of filepaths.

See Also

download.file

Examples

Run this code
## Destination folder for data download
gimms_dir <- paste0(getwd(), "/data")

## Download GIMMS NDVI3g binary data from 2000-2005 (this might take some time...)
gimms_files <- downloadGimms(x = 2000, y = 2005, dsn = gimms_dir)
gimms_files[1:10]

Run the code above in your browser using DataLab