The function only works on the common period of the files without NA values. It operates weighted sums on one or several time-series. It is also possible to add a constant.
h_weightedsum(files, weights, constant = 0)
The function returns + n hts files with the extracted common period + 1 hts file named as the first file of the list with the prefix w_. The sensor id is automatically set to "weighted".
List of file names to proceed
List of weights (must have the same length as files)
Constant to add (default = 0)
P. Chevallier - Oct 2017-Oct 2021
For averaging n time-series one can use n weights wit a value of 1/n and constant = 0.