View source: R/detect_forages.R
detect_forages | R Documentation |
Experimental function to detect forages (time series characterised
by a high "instability").
Already detected cycles are labelled as "forage" (adjacent ones are dissolved)
basing on arguments diff_thr
and ncuts_thr
(see).
detect_forages(
ts,
pheno,
win = NULL,
diff_thr = 10,
ncuts_thr = 10,
sliding = 90,
reldiff = TRUE,
byyear = TRUE
)
ts |
Time series in |
pheno |
Cycle allocation (data table generated by |
win |
List with the allowed ranges for the dates of
start of cycle (see |
diff_thr |
First threshold to detect forages (TODO improve description) |
ncuts_thr |
Second threshold to detect forages (TODO improve description) |
sliding |
Length (in days) of the sliding window in which |
reldiff |
Logical: should argument |
byyear |
Logical: compute aggregation by year (default) or globally (this should make sense in case of permanent crops). |
A data table in the format of the input pheno
,
in which adjacent forage cycles are merged.
An additional logical field forage
discriminates forages from non-forages.
Luigi Ranghetti, PhD (2021) luigi@ranghetti.info
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.