Scale the day of the year to 0-1 (like NDVI).

Usage,
scale_doy(DT, doy = "DayOfYear")

Arguments

DT

data.table of NDVI time series

doy

julian day column. default is 'DayOfYear'. integer type.

Value

data.table with appended 't' column of 0-1 scaled day of year.

See also

Other scale: scale_ndvi

Examples

# Load data.table
library(data.table)

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

# Scale DOY
scale_doy(ndvi)
#>       id   yr DayOfYear  NDVI SummaryQA           t
#>    1:  1 2002         3 -1367         3 0.005479452
#>    2:  2 2002        14  -304         3 0.035616438
#>    3:  3 2002         1   374         2 0.000000000
#>    4:  4 2002        15   635         3 0.038356164
#>    5:  5 2002         9   685         2 0.021917808
#>   ---                                              
#> 1261:  1 2012       353   151         2 0.964383562
#> 1262:  2 2012       356   330         2 0.972602740
#> 1263:  3 2012       356   560         2 0.972602740
#> 1264:  4 2012       356  1720         2 0.972602740
#> 1265:  5 2012       356  2689         2 0.972602740