Download GIMMS 3G data

Description

Download GIMMS 3G binary data for a given time span from the NASA Ames Ecological Forecasting Lab's FTP server (http://ecocast.arc.nasa.gov/data/pub/gimms/3g.v0/, accessed on January 15, 2016).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S4 method for signature 'Date'
downloadGimms(x, y, dsn = getwd(), overwrite = FALSE,
  quiet = TRUE, mode = "wb", cores = 1L, ...)

## S4 method for signature 'numeric'
downloadGimms(x, y, dsn = getwd(), overwrite = FALSE,
  quiet = TRUE, mode = "wb", cores = 1L, ...)

## S4 method for signature 'character'
downloadGimms(x, dsn = getwd(), overwrite = FALSE,
  quiet = TRUE, mode = "wb", cores = 1L, ...)

## S4 method for signature 'missing'
downloadGimms(dsn = getwd(), overwrite = FALSE,
  quiet = TRUE, mode = "wb", cores = 1L, ...)

Arguments

x

If 'Date', start date for download (e.g. "2000-01-01"). 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 the oldest file available.

y

If 'Date', end date for download. If 'numeric', end year for download. If not supplied, download will stop with the latest file 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

See download.file.

cores

Integer. Number of cores for parallel computing.

...

Further arguments passed on to download.file, e.g. 'method'.

Value

A vector of filepaths.

Author(s)

Florian Detsch

See Also

download.file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
## Destination folder for data download
gimms_dir <- paste0(getwd(), "/data")

## 'Date' method
gimms_files_date <- downloadGimms(x = as.Date("2000-01-01"),
                                  y = as.Date("2000-06-30"),
                                  dsn = gimms_dir)

## 'numeric' method, i.e. full years
gimms_files_year <- downloadGimms(x = 2000, y = 2002, dsn = gimms_dir)

## 'character' method, i.e. file names
gimms_files <- updateInventory()
gimms_files <- gimms_files[grep("geo00", gimms_files)]
gimms_files_char <- downloadGimms(x = gimms_files, dsn = gimms_dir)

## 'missing' method, i.e. entire collection
gimms_files_full <- downloadGimms(dsn = gimms_dir)

## End(Not run)