WeightedMean(): Return error if data is two-dimensional
Hi @nperez
The documentation of WeightedMean() says that the input data can be two-dimensional:
#'@param data An array with minimum two dimensions of latitude and longitude.
But it returns an error because of line 106. It is not a big problem but it causes inconvenience when being used in the startR workflow that an additional dimension needs to be the targe_dim. Please let me know if you want to fix it or you prefer me to do it.
asd <- array(1:10, dim = c(lon = 2, lat = 5))
res <- WeightedMean(asd, lon = c(1, 4), lat = c(10, 20, 30, 40, 50))
Error in dim(wtmean) <- dim(data)[-c(latdim, londim)] :
length-0 dimension vector is invalid
Cheers,
An-Chi