Trend(): Bug in p-value when NAs exist
When the data for trend calculation is full of NA, .Trend() returns NAs for all the outputs (trend, conf.level, p.val, detrend.) p.val
should only have dimension stats = 1
, but now the function returns a vector of NA of length polydeg + 1
. So, if the trend can be calculated (i.e., there is no time vector full of NAs), the returned p.val
will have dimension stats = 1
; but if there is any NA being returned, the dimension becomes stats = (ploydeg + 1)
and the values are wrong (misplaced).
@nperez @vtorralba do you use Trend() to calculate p-value? This is a development for issue #1 (closed) opened by you and I'd like to know if you're impacted by this problem.
P.s., This bug is related to !27 (merged), which changed p.val <- NA
to p.val <- rep(NA, polydeg + 1)
Best,
An-Chi