write_Input: write_input

Description Usage Arguments Note Examples

Description

Write matrix into the format of TIMESAT.

Usage

1
write_input(x, file = "TSM_y.txt", nptperyear = 23, missing = -0.1)

Arguments

x

matrix row is site, column is time.

file

a character string naming a file.

nptperyear

How many points per year?

Note

not allow NA values in x

Examples

 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)

kongdd/rTIMESAT documentation built on Aug. 10, 2021, 4:09 a.m.