ee_max_rolling_sum: ee_max_rolling_sum

View source: R/ee_max_rolling_sum.R

ee_max_rolling_sumR Documentation

ee_max_rolling_sum

Description

ee_max_rolling_sum

Usage

ee_max_rolling_sum(
  x,
  roll_window,
  roll_time_unit = "day",
  from_when = NULL,
  over_time,
  return_tidyee
)

Arguments

x

tidyee class object containing 'ee$ImageCollection'

roll_window

time window to calculate rolling statistic (currently only supports days)

roll_time_unit

time unit (currently only supports days)

from_when

character date from which you want to end the rolling calculation (by default will use the late of last image)

over_time

over how many days do you want to calculate the maximum of the rolling sum pixels

return_tidyee

logical if T will return 'tidyee' class if F will return 'ee$Image' (note: F will be faster)

Value

'tidyee' or 'ee$Image' object containing image with maximum rolling sum composite on a per pixel basis

Examples

## Not run: 
library(surveyGEER)
library(rgee)
library(tidyverse)
library(tidyrgee)
ee_Initialize()
chirps_link <- "UCSB-CHG/CHIRPS/DAILY"
chirpsIC <- ee$ImageCollection(chirps_link)

# create tidyee class object
chirps_tidy <- as_tidyee(chirpsIC)

# from "2022-05-31" I want to calculate the maximum 3 day precipitation event over the past 60 days

  rainfall_3day_max_60days <- ee_max_rolling_sum(
      x = chirps_tidy,
      roll_window = 3,
      roll_time_unit = "day",
      from_when = "2022-05-31",
      over_time = 60,
      return_tidyee = F)

## End(Not run)

impact-initiatives-geospatial/surveyGEER documentation built on Feb. 4, 2023, 12:13 p.m.