get_linear: Get Linear Regression

View source: R/get.R

get_linearR Documentation

Get Linear Regression

Description

This function allows the user to get a linearFit() from an ImageCollection.

Usage

get_linear(data, band = NULL, stat = "median", temporal = "yearly")

Arguments

data

A previously create get_* object.

band

A character indicating what bands/type to use when you have more than one. Can only select one, e.g. 'NDVI'.

stat

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

temporal

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

Value

A list of Earth Engine Objects and arguments. Specifically an ImageCollection with bands c('scale', 'offset').

Examples

## Not run: 
# Load Libraries

library(rgee)
ee_Initialize()
library(exploreRGEE)

# Bring in data
huc <- exploreRGEE::huc

# get intitial image. Can by any get_*().

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

# now subtract from new one

lr <- ld8 %>% get_linear(band = 'NDVI', temporal = 'yearly')

lr %>% viz(band = 'scale')

## End(Not run)

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