Matches two vectors with different lengths based on their maximum value.
Target numeric vector.
Two element numeric vector.
The function counts the number of value segments in x that are above its mean effectively counting the number of crop cycles. Before reporting the final value, min.length is used to filter outliers. The first element filters segments that lie below the mean (i.e. recently cultivated/harvested). If the segment length is greater than the 1st element in min.length the segment is relabeled as "1 (i.e. "crop growth/maturity". This process is repeated for segments above the mean (i.e. crop growth/maturity). If the length of a segment is greater than the second element in min.length it is labeled as "recently cultivated/harvested".
A numeric element with the number of crop cycles in x.
1 2 3 4 5 6 7 8 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.