Using filtered NDVI time series, scale it to 0-1.

Usage,
scale_ndvi(DT)

Arguments

DT

data.table of NDVI time series

Value

data.table with appended 'scaled' column of 0-1 scaled NDVI.

Details

This functions expects the input DT is the output of previous four filtering steps, or filter_ndvi.

See also

Other scale: scale_doy

Examples

# Load data.table
library(data.table)

# Read in example data
ndvi <- fread(system.file("extdata", "ndvi.csv", package = "irg"))

# Filter and scale NDVI time series
filter_ndvi(ndvi)
#>       id   yr DayOfYear  NDVI SummaryQA filtered winter rolled    top
#>    1:  1 2002         3 -1367         3     4099   4099   4099 7443.4
#>    2:  2 2002        14  -304         3     5382   5382   5382 7462.9
#>    3:  3 2002         1   374         2     3702   3702   3702 6709.8
#>    4:  4 2002        15   635         3     5180   5180   5180 7288.1
#>    5:  5 2002         9   685         2     4621   4621   4621 7645.1
#>   ---                                                                
#> 1261:  1 2012       353   151         2     4099   4099   4099 7443.4
#> 1262:  2 2012       356   330         2     5382   5382   5382 7462.9
#> 1263:  3 2012       356   560         2     3702   3702   3702 6709.8
#> 1264:  4 2012       356  1720         2     5180   5180   5180 7288.1
#> 1265:  5 2012       356  2689         2     4621   4621   4621 7645.1
scale_ndvi(ndvi)
#>       id   yr DayOfYear  NDVI SummaryQA filtered winter rolled    top scaled
#>    1:  1 2002         3 -1367         3     4099   4099   4099 7443.4      0
#>    2:  2 2002        14  -304         3     5382   5382   5382 7462.9      0
#>    3:  3 2002         1   374         2     3702   3702   3702 6709.8      0
#>    4:  4 2002        15   635         3     5180   5180   5180 7288.1      0
#>    5:  5 2002         9   685         2     4621   4621   4621 7645.1      0
#>   ---                                                                       
#> 1261:  1 2012       353   151         2     4099   4099   4099 7443.4      0
#> 1262:  2 2012       356   330         2     5382   5382   5382 7462.9      0
#> 1263:  3 2012       356   560         2     3702   3702   3702 6709.8      0
#> 1264:  4 2012       356  1720         2     5180   5180   5180 7288.1      0
#> 1265:  5 2012       356  2689         2     4621   4621   4621 7645.1      0