getCollection

0th

Percentile

Get Available Collections of MODIS Product(s)

Checks and retrieves available MODIS collection(s) for a given product.

Usage
getCollection(
  product,
  collection = NULL,
  newest = TRUE,
  forceCheck = FALSE,
  as = "character",
  ...
)
Arguments
product

character. MODIS grid product to check for existing collections, see getProduct.

collection

character or integer. If provided, the function only checks if the specified collection exists and returns the collection number formatted based on the as parameter or FALSE if it doesn't exists. The check is performed on LP DAAC as the exclusive source for several products or, for snow cover (MOD/MYD10) and sea ice extent (MOD/MYD29), NSIDC.

newest

logical. If TRUE (default), return only the newest collection, else return all available collections.

forceCheck

logical, defaults to FALSE. If TRUE, connect to the 'LP DAAC' or 'NSIDC' server and get available collections, of which an updated version is permanently stored in MODIS:::combineOptions()$auxPath.

as

character, defaults to 'character' which returns the typical 3-digit collection number (i.e., "005"). as = 'numeric' returns the result as numeric (i.e., 5).

...

Additional arguments passed to MODISoptions. Permanent settings for these arguments are temporarily overridden.

Value

A 3-digit character or numeric object (depending on 'as') or, if length(product) > 1, a list of such objects with each slot corresponding to the collection available for a certain product. Additionally, a text file in a hidden folder located in getOption("MODIS_localArcPath") as database for future calls. If 'collection' is provided, only the (formatted) collection (or FALSE if it could not be found) is returned.

See Also

getProduct.

Aliases
  • getCollection
Examples
# NOT RUN {
# update or get collections for MCD12C1 and MCD12Q1
getCollection(product = "MCD12.*")
getCollection(product = "MCD12.*", newest = FALSE)
getCollection(product = "MCD12.*", forceCheck = TRUE)
# }
# NOT RUN {
# }
Documentation reproduced from package MODIS, version 1.1.7, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.