BirdScanCommunity / birdscanR

3 stars 2 forks source link

computeMTR.R: computed spread when calculating per day/night differ compared to the reference dataset data #18

Closed fabian-hertner closed 2 years ago

fabian-hertner commented 2 years ago

When using the new/fast computeMTR.R function, I get the correct MTR, but the spread (first & third quartile) of the MTR, when combining e.g. 1h-MTR per day/night, is different compared with the result when using the old/slow computeMTR function. @baptischmi : How do you calculate the spread? Is there an error in the new or the old version of the function?

baptischmi commented 2 years ago

thanks! I have actually not changed the part of the coding where you calculate the spread, so it must come from the data used as input for this section of the code. Can you check for any differences in the input data (old vs. new)? I guess, the main difference will come into addressing NA and Zero… I kind of remember to have documented this difference.

fabian-hertner commented 2 years ago

Replaced the function 'weighted.quantile' with the 'quantile' function which caused problems with some data and the quantile does not need to be weighted.