Description Usage Arguments Note Examples
Write matrix into the format of TIMESAT.
1 | write_input(x, file = "TSM_y.txt", nptperyear = 23, missing = -0.1)
|
x |
matrix row is site, column is time. |
file |
a character string naming a file. |
nptperyear |
How many points per year? |
not allow NA values in x
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(rTIMESAT)
data("MOD13A1")
df <- subset(MOD13A1$dt, date >= as.Date("2010-01-01") & date <= as.Date("2017-12-31"))
sitename <- "CA-NS6"
d <- subset(df, site == sitename)
nptperyear <- 23
file_y <- sprintf("TSM_%s_y.txt", sitename)
file_qc <- sprintf("TSM_%s_w.txt", sitename)
write_input(d$EVI/1e4 , file_y, nptperyear)
write_input(d$SummaryQA, file_qc, nptperyear)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.