Running ‘testthat.R’ [249s/214s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(meteoland)
  Package 'meteoland' [ver. 2.2.3]
  > 
  > test_check("meteoland")
  Starting 2 test processes
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 333 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-03_interpolator_object.R:11:3'): create_meteo_interpolator works as expected ──
  Error in ``/.difftime`(diff(range(ud)), mean(ud))`: second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-03_interpolator_object.R:11:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─meteoland::create_meteo_interpolator(meteo_test_correct, params = list(debig = FALSE))
    8.   ├─stars::st_dimensions(date = dates, station = stations)
    9.   └─stars:::st_dimensions.default(date = dates, station = stations)
   10.     ├─stars:::create_dimensions(...)
   11.     └─base::mapply(...)
   12.       └─stars (local) `<fn>`(...)
   13.         └─stars:::regular_intervals(values)
   14.           ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   15.           └─base::`/.difftime`(diff(range(ud)), mean(ud))
  ── Error ('test-03_interpolator_object.R:161:1'): (code run outside of `test_that()`) ──
  Error in ``/.difftime`(diff(range(ud)), mean(ud))`: second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─base::suppressWarnings(interpolator_test <- create_meteo_interpolator(meteo_test_correct)) at test-03_interpolator_object.R:161:1
    2. │ └─base::withCallingHandlers(...)
    3. └─meteoland::create_meteo_interpolator(meteo_test_correct)
    4.   ├─stars::st_dimensions(date = dates, station = stations)
    5.   └─stars:::st_dimensions.default(date = dates, station = stations)
    6.     ├─stars:::create_dimensions(...)
    7.     └─base::mapply(...)
    8.       └─stars (local) `<fn>`(...)
    9.         └─stars:::regular_intervals(values)
   10.           ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   11.           └─base::`/.difftime`(diff(range(ud)), mean(ud))
  ── Error ('test-04_interpolation_framework.R:62:3'): interpolation process works as intended ──
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)`: i In argument: `interpolated_data = res_list`.
  Caused by error in `/.difftime`:
  ! second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-04_interpolation_framework.R:62:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─meteoland::interpolate_data(...)
    8. │ ├─meteoland:::.binding_interpolation_results(...)
    9. │ │ ├─sf::st_as_sf(dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list))
   10. │ │ ├─dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
   11. │ │ └─dplyr:::mutate.data.frame(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
   12. │ │   └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
   13. │ │     ├─base::withCallingHandlers(...)
   14. │ │     └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
   15. │ │       └─mask$eval_all_mutate(quo)
   16. │ │         └─dplyr (local) eval()
   17. │ └─meteoland:::.interpolation_spatial_dispatcher(...)
   18. │   └─meteoland:::.interpolation_point(...)
   19. │     ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
   20. │     └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
   21. │       ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   22. │       ├─stars:::st_as_stars.list(...)
   23. │       └─stars:::get_dims(cb$dims, st_dimensions(.data))
   24. │         └─stars:::create_dimension(...)
   25. │           └─stars:::regular_intervals(values)
   26. │             ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   27. │             └─base::`/.difftime`(diff(range(ud)), mean(ud))
   28. │               └─base::stop("second argument of / cannot be a \"difftime\" object")
   29. └─base::.handleSimpleError(...)
   30.   └─dplyr (local) h(simpleError(msg, call))
   31.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test-04_interpolation_framework.R:447:3'): interpolation cross validation works as expected ──
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `purrr::map(stations, .station_cross_validation, interpolator = interpolator, 
      .progress = verbose)`: i In index: 1.
  Caused by error in `/.difftime`:
  ! second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─testthat::expect_type(...) at test-04_interpolation_framework.R:447:3
    2. │ └─testthat::quasi_label(enquo(object), arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─meteoland::interpolation_cross_validation(meteoland_interpolator_example)
    5. │ ├─meteoland:::.set_predicted_nas(...)
    6. │ ├─purrr::list_rbind(...)
    7. │ │ └─purrr:::check_list_of_data_frames(x)
    8. │ │   └─vctrs::vec_check_list(x, call = error_call)
    9. │ │     └─vctrs::obj_check_list(x, ..., arg = arg, call = call)
   10. │ └─purrr::map(...)
   11. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   12. │     ├─purrr:::with_indexed_errors(...)
   13. │     │ └─base::withCallingHandlers(...)
   14. │     ├─purrr:::call_with_cleanup(...)
   15. │     └─meteoland (local) .f(.x[[i]], ...)
   16. │       ├─dplyr::rename(...)
   17. │       ├─dplyr::mutate(...)
   18. │       ├─base::suppressMessages(...)
   19. │       │ └─base::withCallingHandlers(...)
   20. │       ├─base::suppressWarnings(...)
   21. │       │ └─base::withCallingHandlers(...)
   22. │       └─meteoland:::.interpolation_point(...)
   23. │         ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
   24. │         └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
   25. │           ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   26. │           ├─stars:::st_as_stars.list(...)
   27. │           └─stars:::get_dims(cb$dims, st_dimensions(.data))
   28. │             └─stars:::create_dimension(...)
   29. │               └─stars:::regular_intervals(values)
   30. │                 ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   31. │                 └─base::`/.difftime`(diff(range(ud)), mean(ud))
   32. │                   └─base::stop("second argument of / cannot be a \"difftime\" object")
   33. └─base::.handleSimpleError(...)
   34.   └─purrr (local) h(simpleError(msg, call))
   35.     └─cli::cli_abort(...)
   36.       └─rlang::abort(...)
  ── Error ('test-05_summary_interpolated_data.R:2:3'): summarise_interpolated_data for sf works as expected ──
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)`: i In argument: `interpolated_data = res_list`.
  Caused by error in `/.difftime`:
  ! second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─meteoland::interpolate_data(...) at test-05_summary_interpolated_data.R:2:3
    2. │ ├─meteoland:::.binding_interpolation_results(...)
    3. │ │ ├─sf::st_as_sf(dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list))
    4. │ │ ├─dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
    5. │ │ └─dplyr:::mutate.data.frame(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
    6. │ │   └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
    7. │ │     ├─base::withCallingHandlers(...)
    8. │ │     └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
    9. │ │       └─mask$eval_all_mutate(quo)
   10. │ │         └─dplyr (local) eval()
   11. │ └─meteoland:::.interpolation_spatial_dispatcher(...)
   12. │   └─meteoland:::.interpolation_point(...)
   13. │     ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
   14. │     └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
   15. │       ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   16. │       ├─stars:::st_as_stars.list(...)
   17. │       └─stars:::get_dims(cb$dims, st_dimensions(.data))
   18. │         └─stars:::create_dimension(...)
   19. │           └─stars:::regular_intervals(values)
   20. │             ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   21. │             └─base::`/.difftime`(diff(range(ud)), mean(ud))
   22. │               └─base::stop("second argument of / cannot be a \"difftime\" object")
   23. └─base::.handleSimpleError(...)
   24.   └─dplyr (local) h(simpleError(msg, call))
   25.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test-05_summary_interpolated_data.R:225:3'): summarise_interpolated_data for stars works as expected ──
  Error in ``/.difftime`(diff(range(ud)), mean(ud))`: second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. └─meteoland::interpolate_data(...) at test-05_summary_interpolated_data.R:225:3
    2.   ├─meteoland:::.binding_interpolation_results(...)
    3.   │ ├─stars::st_dimensions(...)
    4.   │ └─stars:::st_dimensions.default(...)
    5.   └─meteoland:::.interpolation_spatial_dispatcher(...)
    6.     └─meteoland:::.interpolation_point(...)
    7.       ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
    8.       └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
    9.         ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   10.         ├─stars:::st_as_stars.list(...)
   11.         └─stars:::get_dims(cb$dims, st_dimensions(.data))
   12.           └─stars:::create_dimension(...)
   13.             └─stars:::regular_intervals(values)
   14.               ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   15.               └─base::`/.difftime`(diff(range(ud)), mean(ud))
  ── Error ('test-05_summary_interpolated_data.R:381:3'): summarise_interpolator works as expected ──
  Error in ``/.difftime`(diff(range(ud)), mean(ud))`: second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-05_summary_interpolated_data.R:381:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─meteoland::summarise_interpolator(...)
    8. │ ├─assertthat::assert_that(.is_interpolator(interpolator))
    9. │ │ └─assertthat::see_if(..., env = env, msg = msg)
   10. │ │   ├─base::tryCatch(...)
   11. │ │   │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   12. │ │   │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   13. │ │   │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   14. │ │   └─base::eval(assertion, env)
   15. │ │     └─base::eval(assertion, env)
   16. │ └─meteoland:::.is_interpolator(interpolator)
   17. │   └─meteoland::get_interpolation_params(interpolator)
   18. └─meteoland::interpolate_data(...)
   19.   ├─meteoland:::.binding_interpolation_results(...)
   20.   │ ├─stars::st_dimensions(...)
   21.   │ └─stars:::st_dimensions.default(...)
   22.   └─meteoland:::.interpolation_spatial_dispatcher(...)
   23.     └─meteoland:::.interpolation_point(...)
   24.       ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
   25.       └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
   26.         ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   27.         ├─stars:::st_as_stars.list(...)
   28.         └─stars:::get_dims(cb$dims, st_dimensions(.data))
   29.           └─stars:::create_dimension(...)
   30.             └─stars:::regular_intervals(values)
   31.               ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   32.               └─base::`/.difftime`(diff(range(ud)), mean(ud))
  ── Error ('test-21_meteoland_utils.R:293:3'): precipitation_rainfall_erosivity works as expected ──
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)`: i In argument: `interpolated_data = res_list`.
  Caused by error in `/.difftime`:
  ! second argument of / cannot be a "difftime" object
  Backtrace:
       ▆
    1. ├─testthat::expect_s3_class(...) at test-21_meteoland_utils.R:293:3
    2. │ └─testthat::quasi_label(enquo(object), arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─dplyr::mutate(...)
    5. ├─meteoland::interpolate_data(...)
    6. │ ├─meteoland:::.binding_interpolation_results(...)
    7. │ │ ├─sf::st_as_sf(dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list))
    8. │ │ ├─dplyr::mutate(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
    9. │ │ └─dplyr:::mutate.data.frame(dplyr::as_tibble(spatial_data), interpolated_data = res_list)
   10. │ │   └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
   11. │ │     ├─base::withCallingHandlers(...)
   12. │ │     └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
   13. │ │       └─mask$eval_all_mutate(quo)
   14. │ │         └─dplyr (local) eval()
   15. │ └─meteoland:::.interpolation_spatial_dispatcher(...)
   16. │   └─meteoland:::.interpolation_point(...)
   17. │     ├─dplyr::filter(interpolator, as.Date(date) %in% as.Date(dates))
   18. │     └─stars:::filter.stars(interpolator, as.Date(date) %in% as.Date(dates))
   19. │       ├─stars::st_as_stars(cb$mets, dimensions = get_dims(cb$dims, st_dimensions(.data)))
   20. │       ├─stars:::st_as_stars.list(...)
   21. │       └─stars:::get_dims(cb$dims, st_dimensions(.data))
   22. │         └─stars:::create_dimension(...)
   23. │           └─stars:::regular_intervals(values)
   24. │             ├─base::isTRUE(as.numeric(abs(diff(range(ud))/mean(ud))) < epsilon)
   25. │             └─base::`/.difftime`(diff(range(ud)), mean(ud))
   26. │               └─base::stop("second argument of / cannot be a \"difftime\" object")
   27. └─base::.handleSimpleError(...)
   28.   └─dplyr (local) h(simpleError(msg, call))
   29.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 333 ]
  Error: Test failures
  Execution halted