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

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: 7652 2002 3 -1367 3 0.005479452 #> 2: 7035 2002 14 -304 3 0.035616438 #> 3: 4368 2002 1 374 2 0.000000000 #> 4: 5196 2002 15 635 3 0.038356164 #> 5: 12377 2002 9 685 2 0.021917808 #> --- #> 2526: 13322 2012 356 1257 2 0.972602740 #> 2527: 9537 2012 356 144 2 0.972602740 #> 2528: 18592 2012 362 1031 2 0.989041096 #> 2529: 2163 2012 356 2172 2 0.972602740 #> 2530: 2941 2012 356 -197 2 0.972602740