View source: R/ee_ImageCollection.R
ee_ImageCollection_closest | R Documentation |
Gets the closest ee$Image to a specified date from an ee$ImageCollection.
`ee$ImageCollection$Extra_closest(x, ...)`
x |
ee$ImageCollection from which to get the closest image to the specified date. |
... |
Additional arguments for finding the nearest image. See details for more information. |
The ...
argument can include the following:
dateee$Date or R date object. Date of interest for searching the closest image.
toleranceNumeric. Filters the collection within a range of (date - tolerance, date + tolerance). Default 1.
unitCharacter. Units for tolerance. Options include "year", "month", "week", "day", "hour", "minute", "second". Default "month".
These parameters allow for precise control over how the closest image is determined.
An ee$Image closest to the specified date.
## Not run:
library(rgee)
library(rgeeExtra)
ee_Initialize()
roi <- ee$Geometry$Point(c(-79, -12))
ee$ImageCollection$Dataset$MODIS_006_MCD12Q1 %>%
ee$ImageCollection$Extra_closest("2020-10-15", 2, "year") %>%
ee$ImageCollection$first() %>%
Map$addLayer()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.