hzambran / hydroGOF

Goodness-of-fit functions for comparison of simulated and observed hydrological time series
https://CRAN.R-project.org/package=hydroGOF
39 stars 13 forks source link

Problem with condition missing #8

Closed NUForever closed 9 months ago

NUForever commented 5 years ago

In (at least) this functions: rd.default cp.default rsr.default rsD.default br2.default pbias.default, etc

In the line when "denominator" argument is used as a condition inside an if-else, instead of

if (denominator != 0) { ...

i suggest use

if (denominator != 0 || is.na(denominator)) { ...

This can avoid issues. Thanks for the package by the way, great tool

hzambran commented 9 months ago

Thank you very much for the comment.

A modified version of the condition that verify that denominator is not NA is included in the upcoming hydroGOF 0.5-0