ee-subset: Extract or replace parts of ee$Image and ee$ImageCollection

ee-subsetR Documentation

Extract or replace parts of ee$Image and ee$ImageCollection

Description

Extract or replace parts of ee$Image and ee$ImageCollection

Extract or replace parts of and ee$ImageCollection

Usage

## S3 method for class 'ee.image.Image'
x[[index]]

## S3 replacement method for class 'ee.image.Image'
x[index] <- value

## S3 replacement method for class 'ee.image.Image'
x[[index]] <- value

## S3 method for class 'ee.imagecollection.ImageCollection'
x[[index]]

## S3 replacement method for class 'ee.imagecollection.ImageCollection'
x[[index]] <- value

Arguments

x

ee$ImageCollection or ee$Image.

index

Integer. Index specifying elements to extract or replace.

value

ee$ImageCollection or ee$Image to replace in.

Value

Bands of ee$Image or an ee$Image

An EE.ImageCollection

Examples

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

ee_Initialize(gcs = TRUE, drive = TRUE)

# Define a Image or ImageCollection: Terraclimate
terraclimate <- ee$ImageCollection("IDAHO_EPSCOR/TERRACLIMATE") %>%
  ee$ImageCollection$filterDate("2001-01-01", "2002-01-01")

# Define temperature Vis parameters
maximumTemperatureVis <- list(
  min = -300.0,
  max = 300.0,
  palette = c(
    '1a3678', '2955bc', '5699ff', '8dbae9', 'acd1ff', 'caebff', 'e5f9ff',
    'fdffb4', 'ffe6a2', 'ffc969', 'ffa12d', 'ff7c1f', 'ca531a', 'ff0000',
    'ab0000'
  )
)

Map$setCenter(71.72, 52.48, 2)
tnames <- names(terraclimate[[2]])
m1 <- Map$addLayer(terraclimate[[2]][["tmmx"]], maximumTemperatureVis)

terraclimate[[2]] <- terraclimate[[2]]*1.4
names(terraclimate[[2]]) <- tnames
m2 <- Map$addLayer(terraclimate[[2]][["tmmx"]], maximumTemperatureVis)
m1 | m2

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

ee_Initialize(gcs = TRUE, drive = TRUE)
extra_Initialize()
# Define a Image or ImageCollection: Terraclimate

## End(Not run)

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