Learn R Programming

rgee (version 1.0.9)

ee_subsetting: Extract or replace parts of and ee$ImageCollection

Description

Extract or replace parts of and ee$ImageCollection

Usage

# S3 method for ee.imagecollection.ImageCollection
[[(x, index)

# S3 method for ee.imagecollection.ImageCollection [[(x, index) <- value

# S3 method for ee.image.Image [[(x, index)

# S3 method for ee.image.Image [[(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.

Examples

Run this code
# NOT RUN {
library(rgee)
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)
m1 <- Map$addLayer(terraclimate[[2]][["tmmx"]], maximumTemperatureVis)

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

Run the code above in your browser using DataLab