Open raffaele-morelli opened 6 months ago
Reprex to confirm:
library(openair)
mary <- importAURN(site = "my1", year = c(seq(2000, 2009, 1), seq(2011, 2019, 1)))
result <- TheilSen(mary, pollutant = "no2")
#> Taking bootstrap samples. Please wait.
result$data[[2]]
#> # A tibble: 2 × 20
#> default p.stars date conc a b upper.a upper.b lower.a
#> <chr> <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 default *** 2009-12-06 94.7 137. -0.00305 118. -0.00182 158.
#> 2 default <NA> 2010-06-16 NaN NaN NaN NaN NaN NaN
#> # ℹ 11 more variables: lower.b <dbl>, p <dbl>, slope <dbl>, intercept <dbl>,
#> # intercept.lower <dbl>, intercept.upper <dbl>, lower <dbl>, upper <dbl>,
#> # slope.percent <dbl>, lower.percent <dbl>, upper.percent <dbl>
Created on 2024-08-07 with reprex v2.1.1
However, you can see that the slope.percent
, lower.percent
and upper.percent
are the same as the initial line. I suspect this is a bug when combining the data output, in the sense that those percentages are added twice. When calculating a single line, I would explicitly target the first results (i.e. result$data[[2]][1,]
)
Question
Hi,
I am working on data with missing months:
Looking at
MKresults$data[[2]]
we see a table with two lines, one referring to 2019-06-27 and the other to 2018-11-08.Why two lines with all NaN except for slope.percent lower.percent upper.percent ?
Regards