getCollection.Rd 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/getCollection.R
  3. \name{getCollection}
  4. \alias{getCollection}
  5. \title{Get Available Collections of MODIS Product(s)}
  6. \usage{
  7. getCollection(product, collection = NULL, newest = TRUE,
  8. forceCheck = FALSE, as = "character", quiet = TRUE, ...)
  9. }
  10. \arguments{
  11. \item{product}{\code{character}. MODIS grid product to check for existing
  12. collections, see \code{\link{getProduct}}.}
  13. \item{collection}{\code{character} or \code{integer}. If provided, the
  14. function only checks if the specified collection exists and returns the
  15. collection number formatted based on the \code{as} parameter or \code{FALSE}
  16. if it doesn't exists. The check is performed on
  17. \href{https://lpdaac.usgs.gov/}{LP DAAC} as the exclusive source for several
  18. (but by far not all) products.}
  19. \item{newest}{\code{logical}. If \code{TRUE} (default), return only the
  20. newest collection, else return all available collections.}
  21. \item{forceCheck}{\code{logical}, defaults to \code{FALSE}. If \code{TRUE},
  22. connect to the 'LP DAAC' FTP server and get available collections, of which
  23. an updated version is permanently stored in
  24. \code{MODIS:::combineOptions()$auxPath}.}
  25. \item{as}{\code{character}, defaults to \code{'character'} which returns the
  26. typical 3-digit collection number (i.e., \code{"005"}). \code{as = 'numeric'}
  27. returns the result as \code{numeric} (i.e., \code{5}).}
  28. \item{quiet}{\code{logical}, defaults to \code{TRUE}.}
  29. \item{...}{Additional arguments passed to \code{MODIS:::combineOptions}.}
  30. }
  31. \value{
  32. A 3-digit \code{character} or \code{numeric} object (depending on 'as') or,
  33. if \code{length(product) > 1}, a \code{list} of such objects with each slot
  34. corresponding to the collection available for a certain product.
  35. Additionally, a text file in a hidden folder located in
  36. \code{getOption("MODIS_localArcPath")} as database for future calls. If
  37. 'collection' is provided, only the (formatted) collection (or \code{FALSE} if
  38. it could not be found) is returned.
  39. }
  40. \description{
  41. Checks and retrieves available MODIS collection(s) for a given product.
  42. }
  43. \examples{
  44. \dontrun{
  45. # update or get collections for MOD11C3 and MYD11C3
  46. getCollection(product="M.D11C3")
  47. getCollection(product="M.D11C3",newest=FALSE)
  48. getCollection(product="M.D11C3",collection=3)
  49. getCollection(product="M.D11C3",collection=41)
  50. getCollection(product="M.D11C3",collection="041")
  51. getCollection(product="M.D11C3",forceCheck=TRUE)
  52. }
  53. }
  54. \seealso{
  55. \code{\link{getProduct}}.
  56. }
  57. \author{
  58. Matteo Mattiuzzi, Florian Detsch
  59. }