Add the data of the year of year_start - 1 to the head, add the data of the year of year_end - 1 to the tail.

add_HeadTail(d, south = FALSE, nptperyear, trs = 0.45)

Arguments

d

A data.table, should have t (compositing date) or date (image date) column which are (Date variable).

south

Boolean. In south hemisphere, growing year is 1 July to the following year 31 June; In north hemisphere, growing year is 1 Jan to 31 Dec.

nptperyear

Integer, number of images per year.

trs

If nmissing < trs*nptperyear (little missing), this year is include to extract phenology; if FALSE, this year is excluded.

Value

data.table

Note

date is image date; t is compositing date.

Examples

library(phenofit)
#> Error in library(phenofit): there is no package called ‘phenofit’
data("MOD13A1")
#> Warning: data set ‘MOD13A1’ not found
dt <- tidy_MOD13(MOD13A1$dt)
#> Error in tidy_MOD13(MOD13A1$dt): object 'MOD13A1' not found
st <- MOD13A1$st
#> Error in eval(expr, envir, enclos): object 'MOD13A1' not found
sitename <- dt$site[1]
#> Error in dt$site: object of type 'closure' is not subsettable
d <- dt[site == sitename, ] # get the first site data
#> Error in eval(expr, envir, enclos): object 'site' not found
sp <- st[site == sitename, ] # station point
#> Error in eval(expr, envir, enclos): object 'st' not found
nptperyear = 23 dnew <- add_HeadTail(d, nptperyear = nptperyear) # add one year in head and tail
#> Error in is.data.frame(x): object 'd' not found