ee_get: Return the element at a specified position in an Earth Engine...

View source: R/ops-subsetting.R

ee_getR Documentation

Return the element at a specified position in an Earth Engine Image or ImageCollection

Description

Return the element at a specified position in an Earth Engine Image or ImageCollection

Usage

ee_get(ee_c, index = 0)

Arguments

ee_c

ImageCollection or FeatureCollection.

index

Numeric. Specified position.

Value

Depending of ee_c can return either an ee$FeatureCollection or ee$ImageCollection.

Examples

## Not run: 
library(rgee)
library(sf)


ee_Initialize()

nc <- st_read(system.file("shape/nc.shp", package = "sf")) %>%
  st_transform(4326) %>%
  sf_as_ee()

ee_s2 <- ee$ImageCollection("COPERNICUS/S2")$
  filterDate("2016-01-01", "2016-01-31")$
  filterBounds(nc)

ee_s2$size()$getInfo() # 126

# Get the first 5 elements
ee_get(ee_s2, index = 0:4)$size()$getInfo() # 5

## End(Not run)

r-earthengine/rgeeExtra documentation built on Dec. 7, 2023, 9:03 p.m.