Learn R Programming

gimms (version 0.3.0)

rearrangeFiles: Rearrange GIMMS files by date

Description

Rearrange a vector of GIMMS files in ascending order of time. If no file vector is supplied, the function will look for compatible files in the current working directory.

Usage

rearrangeFiles(x = NULL, dsn = getwd(), pattern = "^geo.*.VI3g$",
  pos = c(4, 6, 11), ...)

Arguments

x
Character. Vector of (local or online) filepaths. If NULL, dsn will be searched for available files via pattern matching.
dsn
Character. Path to look for GIMMS data. If not supplied and is.null(fls), this argument defaults to the current working directory.
pattern
Character. A regular expression passed on to list.files.
pos
Integer. The start positions of year, month and period ('a' or 'b') in the desired GIMMS NDVI3g files. Unless modified, this usually defaults to c(4, 6, 11) (see also http://ecocast.arc.nasa.gov/data/pub/gimms/3g.v0/00READMEgeo.txt
...
Further arguments passed on to list.files.

Value

  • A vector of filepaths arranged in ascending order of time.

See Also

list.files

Examples

Run this code
## latest version of files inventory
gimms_files <- updateInventory(sort = FALSE)
head(gimms_files)

## re-arrange vector with available files according to date
gimms_files_arr <- rearrangeFiles(gimms_files)
head(gimms_files_arr)

Run the code above in your browser using DataLab