rcaaqs
rcaaqs copied to clipboard
Tests failing on `main`
==> devtools::test()
ℹ Testing rcaaqs
✔ | F W S OK | Context
✔ | 16 | utility functions
✖ | 1 4 | dates
─────────────────────────────────────────────────────────────────────────
Failure (test-2_dates.R:26:3): format_caaqs_dt works with character
format_caaqs_dt(as.character(dt_seq)) not equal to format_caaqs_dt(dt_seq).
1/6 mismatches
[1] NA - 2017-06-08 23:59:59 == NA secs
─────────────────────────────────────────────────────────────────────────
✔ | 25 | quantile2
✔ | 2 | mean_na
✔ | 4 | rolling_sum
✔ | 4 | rolling_mean
✔ | 3 | n_within_window
✔ | 30 | no2 daily max
✔ | 58 | no2 98 percentile
✖ | 2 54 | no2 three year rolling average
─────────────────────────────────────────────────────────────────────────
Failure (test-5_no2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_no2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
─────────────────────────────────────────────────────────────────────────
✔ | 56 | no2 hourly by year
✖ | 2 24 | o3 rolling 8hr average
─────────────────────────────────────────────────────────────────────────
Failure (test-5_o3_1_rolling_8hr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_o3_1_rolling_8hr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
─────────────────────────────────────────────────────────────────────────
✔ | 30 | o3 daily 8hr max
✔ | 51 | o3 annual 4th highest
✔ | 29 | pm average daily [1.4s]
✔ | 54 | pm 98 percentile
✔ | 48 | pm yearly average
✖ | 2 98 | pm three year rolling average
─────────────────────────────────────────────────────────────────────────
Failure (test-5_pm_4_three_yr_avg.R:53:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_pm_4_three_yr_avg.R:53:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
─────────────────────────────────────────────────────────────────────────
✔ | 30 | so2 daily max
✔ | 58 | so2 99 percentile
✖ | 2 50 | so2 three year rolling average
─────────────────────────────────────────────────────────────────────────
Failure (test-5_so2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_so2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
─────────────────────────────────────────────────────────────────────────
✔ | 58 | so2 hourly by year
✔ | 37 | cut breaks
✔ | 1 84 | no2 caaqs wrappers
─────────────────────────────────────────────────────────────────────────
Warning (test-7_no2_caaqs.R:109:3): caaqs_management for no2 1yr
Using an external vector in selections was deprecated in tidyselect
1.1.0.
ℹ Please use `all_of()` or `any_of()` instead.
# Was:
data %>% select(annual_stat)
# Now:
data %>% select(all_of(annual_stat))
See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
Backtrace:
▆
1. ├─testthat::expect_is(...) at test-7_no2_caaqs.R:109:2
2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
4. ├─rcaaqs::caaqs_management(no2_caaqs_1yr_one)
5. └─rcaaqs:::caaqs_management.no2_1yr(no2_caaqs_1yr_one) at rcaaqs/R/management.R:69:2
6. └─rcaaqs:::caaqs_management_so2_no2_1yr(...) at rcaaqs/R/management.R:223:2
7. └─rcaaqs:::join_management_yearly(...) at rcaaqs/R/management.R:249:2
8. ├─dplyr::select(...) at rcaaqs/R/management.R:274:2
9. └─dplyr:::select.data.frame(...)
10. └─tidyselect::eval_select(expr(c(...)), data = .data, error_call = error_call)
11. └─tidyselect:::eval_select_impl(...)
12. ├─tidyselect:::with_subscript_errors(...)
13. │ └─rlang::try_fetch(...)
14. │ └─base::withCallingHandlers(...)
15. └─tidyselect:::vars_select_eval(...)
16. └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
17. └─tidyselect:::eval_c(expr, data_mask, context_mask)
18. └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
19. └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
20. └─tidyselect:::eval_sym(expr, data_mask, context_mask)
─────────────────────────────────────────────────────────────────────────
✔ | 43 | o3 caaqs wrappers
✔ | 86 | pm caaqs wrappers
✔ | 84 | so2 caaqs wrappers
✔ | 30 | airzone_metric
✔ | 3 26 | plotting
─────────────────────────────────────────────────────────────────────────
Warning (test-9_plot.R:30:3): plot_ts fails correctly
`aes_string()` was deprecated in ggplot2 3.0.0.
ℹ Please use tidy evaluation idioms with `aes()`.
ℹ See also `vignette("ggplot2-in-packages")` for more information.
Backtrace:
▆
1. ├─testthat::expect_error(plot_ts(o3_caaqs, rep_yr = 2025)) at test-9_plot.R:30:2
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. └─rcaaqs::plot_ts(o3_caaqs, rep_yr = 2025)
7. ├─ggplot2::geom_line(...) at rcaaqs/R/plot.R:316:2
8. │ └─ggplot2::layer(...)
9. └─ggplot2::aes_string(x = "date", y = val) at rcaaqs/R/plot.R:316:2
10. └─ggplot2:::deprecate_soft0(...)
Warning (test-9_plot.R:30:3): plot_ts fails correctly
Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
Backtrace:
▆
1. ├─testthat::expect_error(plot_ts(o3_caaqs, rep_yr = 2025)) at test-9_plot.R:30:2
2. │ └─testthat:::quasi_capture(...)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. └─rcaaqs::plot_ts(o3_caaqs, rep_yr = 2025)
7. └─ggplot2::geom_line(...) at rcaaqs/R/plot.R:316:2
8. └─ggplot2::layer(...)
9. └─ggplot2:::deprecate_soft0(...)
Warning (test-9_plot.R:76:3): plot_caaqs() works with pm2.5
Use of .data in tidyselect expressions was deprecated in tidyselect
1.2.0.
ℹ Please use `"metric_value_mgmt"` instead of `.data$metric_value_mgmt`
Backtrace:
▆
1. ├─testthat::expect_message(plot_caaqs(pm_24h_caaqs_one_mgmt), "No valid data") at test-9_plot.R:76:2
2. │ └─testthat:::quasi_capture(enquo(object), label, capture_messages)
3. │ ├─testthat (local) .capture(...)
4. │ │ └─base::withCallingHandlers(...)
5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
6. ├─rcaaqs::plot_caaqs(pm_24h_caaqs_one_mgmt)
7. │ └─... %>% ... at rcaaqs/R/plot.R:106:2
8. ├─dplyr::mutate(...)
9. ├─tidyr::pivot_longer(...)
10. ├─dplyr::select(...)
11. └─dplyr:::select.data.frame(...)
12. └─tidyselect::eval_select(expr(c(...)), data = .data, error_call = error_call)
13. └─tidyselect:::eval_select_impl(...)
14. ├─tidyselect:::with_subscript_errors(...)
15. │ └─rlang::try_fetch(...)
16. │ └─base::withCallingHandlers(...)
17. └─tidyselect:::vars_select_eval(...)
18. └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
19. └─tidyselect:::eval_c(expr, data_mask, context_mask)
20. └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
21. └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
22. └─tidyselect:::expr_kind(expr, context_mask, error_call)
23. └─tidyselect:::call_kind(expr, context_mask, error_call)
─────────────────────────────────────────────────────────────────────────
══ Results ══════════════════════════════════════════════════════════════
Duration: 8.9 s
── Failed tests ─────────────────────────────────────────────────────────
Failure (test-2_dates.R:26:3): format_caaqs_dt works with character
format_caaqs_dt(as.character(dt_seq)) not equal to format_caaqs_dt(dt_seq).
1/6 mismatches
[1] NA - 2017-06-08 23:59:59 == NA secs
Failure (test-5_no2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_no2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_o3_1_rolling_8hr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_o3_1_rolling_8hr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_pm_4_three_yr_avg.R:53:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_pm_4_three_yr_avg.R:53:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_so2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
Failure (test-5_so2_3_three_yr_avg.R:30:5): has correct classes
r$n_val inherits from `'integer'` not `'character'`.
[ FAIL 9 | WARN 4 | SKIP 0 | PASS 1176 ]