Closed aphalo closed 3 months ago
Not easy to implement because we need to pass all the variables to the geometry. As different geometries could be used this is not straightfoward, specially for lines.
At least all variables mapped by default would need to be set to NA or "", but to do this correctly every value returned would need to be set also in the special case to something that does not trigger an error. So, I am closing this.
One could possibly simply return an empty data frame with data.frame()
, I think. It needs to be tested. A warning would also need to be issued.
Implemented by returning data.frame()
from stat_poly_eq()
, stat_poly_line()
, stat_ma_eq()
, stat_ma_line()
, stat_quant_eq()
, stat_quant_line()
, and stat_quant_band()
. No warning is issued, assuming that, if needed, a warning will be issued by the user-defined model fit function. Unit tests added.
stat_poly_line()
,stat_poly_eq()
and relatives should be able to gracefully handleNA
andNULL
returned by model fit methods as an indication of failure, so that in such cases no line or equation is added to the plot. This would be useful in user defined wrappers on model fit methods.