ee_timeseries: Extract Time Series

View source: R/timeseries.R

ee_timeseriesR Documentation

Extract Time Series

Description

This function allows the user to pass a previously created get_*() object or ee ImageCollection to get a time series. This uses the ee_extract function from rgee and does some tidying to return a sf data.frame.

Usage

ee_timeseries(imageCol, ...)

## S3 method for class 'ee.imagecollection.ImageCollection'
ee_timeseries(
  imageCol,
  geom,
  geeFC = NULL,
  scale,
  temporal = "yearly",
  temporal_stat = "mean",
  reducer = "mean",
  lazy = FALSE,
  startDate = NULL,
  endDate = NULL,
  months = NULL,
  ...
)

## S3 method for class 'exploreList'
ee_timeseries(
  imageCol,
  geeFC = NULL,
  scale,
  temporal = "yearly",
  temporal_stat = "mean",
  reducer = "mean",
  lazy = FALSE,
  ...
)

Arguments

imageCol

A previously created get_* object or ee ImageCollection

...

extra args to pass on

geom

A sf data.frame object.

geeFC

A known GEE FeatureCollection or asset, e.g. "USGS/WBD/2017/HUC12"

scale

numeric value indicating what to reduce the regions by, e.g. 800 (m) default.

temporal

A character indicating what temporal filter to use on the collection, e.g. 'yearly' (default), 'monthly', 'year_month', 'all'.

temporal_stat

A character indicating what to filter the ImageCollection when using temporal filtering, e.g. 'median' (default), 'mean', 'max', 'min', 'sum', 'stdDev', 'first'.

reducer

A character indicating what to reduce the ImageCollection when using ee_extract function, e.g. 'median' (default), 'mean', 'max', 'min', 'sum', 'stdDev', 'first'.

lazy

logical whether to run a 'sequential' future in the background or not.

startDate

character format date, e.g. "2018-10-23".

endDate

character format date, e.g. "2018-10-23".

months

numeric vector of monnths, e.g. c(1,12).

Examples

## Not run: 

# Load Libraries

library(rgee)
ee_Initialize()
library(exploreRGEE)

# Bring in data
huc <- exploreRGEE::huc

ld8 <- get_landsat(huc, method = 'ld8', startDate = '2014-01-01',
                  endDate = '2018-12-31', c.low = 6, c.high = 11)

# save both plot and data
ld8_ts <- ld8 %>% ee_timeseries()


## End(Not run)

joshualerickson/exploreRGEE documentation built on May 9, 2022, 10:33 p.m.