Running ‘testthat.R’ [28m/29m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(weathercan)
  > 
  > Sys.setenv("R_TESTS" = "")
  > 
  > test_check("weathercan")
  ── 1. Error: weather (hour) returns a data frame (@test_06_weather_dl.R#6)  ────
  'list' object cannot be coerced to type 'double'
  1: expect_silent({
         weather_dl(station_ids = 51423, start = "2014-01-01", end = "2014-01-31")
     }) at testthat/test_06_weather_dl.R:6
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 51423, start = "2014-01-01", end = "2014-01-31") at testthat/test_06_weather_dl.R:6
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 2. Error: weather (hour) formats timezone display (@test_06_weather_dl.R#34) 
  'list' object cannot be coerced to type 'double'
  1: expect_silent({
         w <- weather_dl(station_ids = 51423, start = "2014-03-01", end = "2014-04-01", 
             tz_disp = "America/Vancouver")
     }) at testthat/test_06_weather_dl.R:34
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 51423, start = "2014-03-01", end = "2014-04-01", tz_disp = "America/Vancouver") at testthat/test_06_weather_dl.R:34
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 3. Error: weather (hour) formats timezone to UTC with multiple zones (@test_0
  'list' object cannot be coerced to type 'double'
  1: expect_silent({
         w <- weather_dl(c(42203, 49909), start = "2017-09-01", end = "2017-09-30")
     }) at testthat/test_06_weather_dl.R:44
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(c(42203, 49909), start = "2017-09-01", end = "2017-09-30") at testthat/test_06_weather_dl.R:44
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 4. Error: weather (hour) gets all (@test_06_weather_dl.R#61)  ───────────────
  'list' object cannot be coerced to type 'double'
  1: expect_silent(w <- weather_dl(station_ids = 50821, start = "2018-01-01", end = "2018-01-02", 
         interval = "hour", trim = FALSE)) at testthat/test_06_weather_dl.R:61
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 50821, start = "2018-01-01", end = "2018-01-02", interval = "hour", 
         trim = FALSE)
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 5. Error: weather (hour) trims NAs (@test_06_weather_dl.R#73)  ──────────────
  'list' object cannot be coerced to type 'double'
  1: expect_equal(nrow(weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", 
         trim = TRUE)), 96) at testthat/test_06_weather_dl.R:73
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: nrow(weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", 
         trim = TRUE))
  5: weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", trim = TRUE)
  6: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  7: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  8: FUN(newX[, i], ...)
  9: tryCatch(as.numeric(x), warning = function(w) w)
  10: tryCatchList(expr, classes, parentenv, handlers)
  11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  12: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 6. Error: weather (hour) multiple stations (@test_06_weather_dl.R#80)  ──────
  'list' object cannot be coerced to type 'double'
  1: expect_silent({
         w <- weather_dl(station_ids = c(51423, 50821), start = "2014-03-01", end = "2014-03-15")
     }) at testthat/test_06_weather_dl.R:80
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = c(51423, 50821), start = "2014-03-01", end = "2014-03-15") at testthat/test_06_weather_dl.R:80
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 7. Error: weather (hour) no data fails nicely (@test_06_weather_dl.R#95)  ───
  'list' object cannot be coerced to type 'double'
  1: expect_silent(expect_message(w1 <- weather_dl(c(1274, 1275), interval = "hour", start = "2012-11-01", 
         end = "2012-12-01"), paste0("There are no data for some stations \\(1274\\)"))) at testthat/test_06_weather_dl.R:95
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: expect_message(w1 <- weather_dl(c(1274, 1275), interval = "hour", start = "2012-11-01", 
         end = "2012-12-01"), paste0("There are no data for some stations \\(1274\\)"))
  10: quasi_capture(enquo(object), label, capture_messages)
  11: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  12: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  13: eval_bare(get_expr(.quo), get_env(.quo))
  14: weather_dl(c(1274, 1275), interval = "hour", start = "2012-11-01", end = "2012-12-01")
  15: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  16: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  17: FUN(newX[, i], ...)
  18: tryCatch(as.numeric(x), warning = function(w) w)
  19: tryCatchList(expr, classes, parentenv, handlers)
  20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  21: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 8. Error: weather (hour) verbose and quiet (@test_06_weather_dl.R#134)  ─────
  'list' object cannot be coerced to type 'double'
  1: expect_message(weather_dl(c(1275, 1001), interval = "hour", start = "2017-01-01", 
         end = "2017-02-01")) at testthat/test_06_weather_dl.R:134
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(1275, 1001), interval = "hour", start = "2017-01-01", end = "2017-02-01")
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 9. Error: weather (hour) handles data with different numbers of columns (@tes
  'list' object cannot be coerced to type 'double'
  1: expect_silent(d <- weather_dl(station_ids = 51423, start = "2018-03-20", end = "2018-04-10")) at testthat/test_06_weather_dl.R:149
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 51423, start = "2018-03-20", end = "2018-04-10")
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 10. Error: weather (hour) skips with message if end date < start date (@test_
  'list' object cannot be coerced to type 'double'
  1: expect_message({
         w <- weather_dl(c(42203, 49909), end = "2006-04-20")
     }, "End date earlier") at testthat/test_06_weather_dl.R:167
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(42203, 49909), end = "2006-04-20") at testthat/test_06_weather_dl.R:167
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 11. Failure: weather (day) returns a data frame (@test_06_weather_dl.R#176)  
  `{ ... }` threw an error.
  Message: 'list' object cannot be coerced to type 'double'
  Class:   simpleError/error/condition
  
  ── 12. Failure: weather (day) returns a data frame (@test_06_weather_dl.R#176)  
  `expect_error(...)` did not produce any messages.
  
  ── 13. Failure: weather (day) returns a data frame (@test_06_weather_dl.R#180)  
  `{ ... }` threw an error.
  Message: 'list' object cannot be coerced to type 'double'
  Class:   simpleError/error/condition
  
  ── 14. Error: weather (day) returns a data frame (@test_06_weather_dl.R#187)  ──
  object 'w' not found
  1: expect_is(w, "data.frame") at testthat/test_06_weather_dl.R:187
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  
  ── 15. Error: weather (day) gets all (@test_06_weather_dl.R#212)  ──────────────
  'list' object cannot be coerced to type 'double'
  1: expect_silent(weather_dl(station_ids = 54398, interval = "day", start = "2016-01-01", 
         end = "2016-12-31", trim = FALSE)) at testthat/test_06_weather_dl.R:212
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 54398, interval = "day", start = "2016-01-01", end = "2016-12-31", 
         trim = FALSE)
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 16. Error: weather (day) trims NAs (@test_06_weather_dl.R#244)  ─────────────
  'list' object cannot be coerced to type 'double'
  1: expect_silent(w1 <- weather_dl(station_ids = 54398, interval = "day", trim = FALSE)) at testthat/test_06_weather_dl.R:244
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 54398, interval = "day", trim = FALSE)
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 17. Failure: weather (day) mutliple stations (@test_06_weather_dl.R#255)  ───
  `... <- NULL` threw an error.
  Message: 'list' object cannot be coerced to type 'double'
  Class:   simpleError/error/condition
  
  ── 18. Error: weather (day) mutliple stations (@test_06_weather_dl.R#259)  ─────
  object 'w' not found
  1: expect_equal(unique(w$station_name), c("MUSKOKA SNOW", "KAMLOOPS A")) at testthat/test_06_weather_dl.R:259
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: unique(w$station_name)
  
  ── 19. Error: weather (day) no data fails nicely (@test_06_weather_dl.R#265)  ──
  'list' object cannot be coerced to type 'double'
  1: expect_silent(expect_message(w0 <- weather_dl(station_ids = 42013, interval = "day", 
         start = "2017-01-01", end = "2017-02-01"), paste0("There are no data for station 42013, ", 
         "in this time range"))) at testthat/test_06_weather_dl.R:265
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: expect_message(w0 <- weather_dl(station_ids = 42013, interval = "day", start = "2017-01-01", 
         end = "2017-02-01"), paste0("There are no data for station 42013, ", "in this time range"))
  10: quasi_capture(enquo(object), label, capture_messages)
  11: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  12: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  13: eval_bare(get_expr(.quo), get_env(.quo))
  14: weather_dl(station_ids = 42013, interval = "day", start = "2017-01-01", end = "2017-02-01")
  15: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  16: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  17: FUN(newX[, i], ...)
  18: tryCatch(as.numeric(x), warning = function(w) w)
  19: tryCatchList(expr, classes, parentenv, handlers)
  20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  21: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 20. Error: weather (day) verbose and quiet (@test_06_weather_dl.R#311)  ─────
  'list' object cannot be coerced to type 'double'
  1: expect_message(weather_dl(c(42013, 51423), interval = "day", start = "2017-01-01", 
         end = "2017-02-01")) at testthat/test_06_weather_dl.R:311
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(42013, 51423), interval = "day", start = "2017-01-01", end = "2017-02-01")
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 21. Failure: weather (day) handles data with different numbers of columns (@t
  `expect_message(...)` threw an error.
  Message: 'list' object cannot be coerced to type 'double'
  Class:   simpleError/error/condition
  
  ── 22. Error: weather (day) handles data with different numbers of columns (@tes
  object 'd' not found
  1: expect_gt(nrow(d), 0) at testthat/test_06_weather_dl.R:330
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: nrow(d)
  
  ── 23. Error: weather (day) skips with message if end date < start date (@test_0
  'list' object cannot be coerced to type 'double'
  1: expect_message({
         w <- weather_dl(c(51423, 4291), end = "1928-11-10", interval = "day")
     }, "End date earlier") at testthat/test_06_weather_dl.R:361
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(51423, 4291), end = "1928-11-10", interval = "day") at testthat/test_06_weather_dl.R:361
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 24. Error: weather (month) returns a data frame (@test_06_weather_dl.R#371)  
  'list' object cannot be coerced to type 'double'
  1: expect_silent(w <- weather_dl(station_ids = 5401, start = "2014-01-01", end = "2014-05-01", 
         interval = "month")) at testthat/test_06_weather_dl.R:371
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 5401, start = "2014-01-01", end = "2014-05-01", interval = "month")
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 25. Error: weather (month) no data fails nicely (@test_06_weather_dl.R#404)  
  'list' object cannot be coerced to type 'double'
  1: expect_silent(expect_message(w1 <- weather_dl(station_ids = c(51423, 1275), interval = "month", 
         start = "2012-01-01", end = "2012-02-01"), paste0("There are no data for some stations \\(51423\\), ", 
         "in this time range \\(2012-01-01 to 2012-02-01\\), ", "for this interval \\(month\\)"))) at testthat/test_06_weather_dl.R:404
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: expect_message(w1 <- weather_dl(station_ids = c(51423, 1275), interval = "month", 
         start = "2012-01-01", end = "2012-02-01"), paste0("There are no data for some stations \\(51423\\), ", 
         "in this time range \\(2012-01-01 to 2012-02-01\\), ", "for this interval \\(month\\)"))
  10: quasi_capture(enquo(object), label, capture_messages)
  11: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  12: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  13: eval_bare(get_expr(.quo), get_env(.quo))
  14: weather_dl(station_ids = c(51423, 1275), interval = "month", start = "2012-01-01", 
         end = "2012-02-01")
  15: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  16: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  17: FUN(newX[, i], ...)
  18: tryCatch(as.numeric(x), warning = function(w) w)
  19: tryCatchList(expr, classes, parentenv, handlers)
  20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  21: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 26. Error: weather (month) multiple stations (@test_06_weather_dl.R#442)  ───
  'list' object cannot be coerced to type 'double'
  1: expect_silent(w <- weather_dl(station_ids = c(5401, 5940), start = "2014-01-01", 
         end = "2014-05-01", interval = "month")) at testthat/test_06_weather_dl.R:442
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = c(5401, 5940), start = "2014-01-01", end = "2014-05-01", 
         interval = "month")
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 27. Failure: weather (month) multiple stations (one NA) (@test_06_weather_dl.
  `... <- NULL` threw an error.
  Message: 'list' object cannot be coerced to type 'double'
  Class:   simpleError/error/condition
  
  ── 28. Failure: weather (month) multiple stations (one NA) (@test_06_weather_dl.
  `expect_error(...)` did not produce any messages.
  
  ── 29. Error: weather (month) multiple stations (one NA) (@test_06_weather_dl.R#
  object 'w' not found
  1: expect_equal(unique(w$station_name), c("MAGOG")) at testthat/test_06_weather_dl.R:456
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: unique(w$station_name)
  
  ── 30. Error: weather (month) verbose and quiet (@test_06_weather_dl.R#460)  ───
  'list' object cannot be coerced to type 'double'
  1: expect_message(weather_dl(c(51423, 1275), interval = "month", start = "2017-01-01", 
         end = "2017-02-01")) at testthat/test_06_weather_dl.R:460
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(51423, 1275), interval = "month", start = "2017-01-01", end = "2017-02-01")
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 31. Error: weather (month) handles data with different numbers of columns (@t
  'list' object cannot be coerced to type 'double'
  1: expect_silent(d <- weather_dl(station_ids = 5217, start = "2016-01-01", end = "2018-12-01", 
         interval = "month")) at testthat/test_06_weather_dl.R:475
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: weather_dl(station_ids = 5217, start = "2016-01-01", end = "2018-12-01", interval = "month")
  10: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  11: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  12: FUN(newX[, i], ...)
  13: tryCatch(as.numeric(x), warning = function(w) w)
  14: tryCatchList(expr, classes, parentenv, handlers)
  15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  16: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 32. Error: weather (month) skips with message if end date < start date (@test
  'list' object cannot be coerced to type 'double'
  1: expect_message({
         w <- weather_dl(c(27534, 4291), end = "1928-11-10", interval = "month")
     }, "End date earlier") at testthat/test_06_weather_dl.R:502
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: weather_dl(c(27534, 4291), end = "1928-11-10", interval = "month") at testthat/test_06_weather_dl.R:502
  7: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  8: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  9: FUN(newX[, i], ...)
  10: tryCatch(as.numeric(x), warning = function(w) w)
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 33. Error: list_col=TRUE and interval=hour groups on the right level (@test_0
  'list' object cannot be coerced to type 'double'
  1: expect_equal(ncol(weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", 
         interval = "hour") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -date)), ncol(weather_dl(station_ids = c(51423), 
         start = "2018-04-01", end = "2018-04-15", interval = "hour", list_col = TRUE))) at testthat/test_06_weather_dl.R:513
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", 
         interval = "hour") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -date))
  5: weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", interval = "hour") %>% 
         tidyr::nest(-dplyr::one_of(names(p_names)), -date)
  6: eval(lhs, parent, parent)
  7: eval(lhs, parent, parent)
  8: weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", interval = "hour")
  9: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  10: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  11: FUN(newX[, i], ...)
  12: tryCatch(as.numeric(x), warning = function(w) w)
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  15: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 34. Error: list_col=TRUE and interval=day groups on the right level (@test_06
  'list' object cannot be coerced to type 'double'
  1: expect_equal(ncol(weather_dl(station_ids = c(27119), start = "2015-01-01", end = "2015-01-15", 
         interval = "day") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -month)), ncol(weather_dl(station_ids = c(27119), 
         start = "2015-01-01", end = "2015-01-15", interval = "day", list_col = TRUE))) at testthat/test_06_weather_dl.R:522
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(weather_dl(station_ids = c(27119), start = "2015-01-01", end = "2015-01-15", 
         interval = "day") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -month))
  5: weather_dl(station_ids = c(27119), start = "2015-01-01", end = "2015-01-15", interval = "day") %>% 
         tidyr::nest(-dplyr::one_of(names(p_names)), -month)
  6: eval(lhs, parent, parent)
  7: eval(lhs, parent, parent)
  8: weather_dl(station_ids = c(27119), start = "2015-01-01", end = "2015-01-15", interval = "day")
  9: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  10: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  11: FUN(newX[, i], ...)
  12: tryCatch(as.numeric(x), warning = function(w) w)
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  15: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 35. Error: list_col=TRUE and interval=month groups on the right level (@test_
  'list' object cannot be coerced to type 'double'
  1: expect_equal(ncol(weather_dl(station_ids = c(5217), start = "2015-01-01", end = "2015-01-15", 
         interval = "month") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -year)), 
         ncol(weather_dl(station_ids = c(5217), start = "2015-01-01", end = "2015-01-15", 
             interval = "month", list_col = TRUE))) at testthat/test_06_weather_dl.R:533
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(weather_dl(station_ids = c(5217), start = "2015-01-01", end = "2015-01-15", 
         interval = "month") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -year))
  5: weather_dl(station_ids = c(5217), start = "2015-01-01", end = "2015-01-15", interval = "month") %>% 
         tidyr::nest(-dplyr::one_of(names(p_names)), -year)
  6: eval(lhs, parent, parent)
  7: eval(lhs, parent, parent)
  8: weather_dl(station_ids = c(5217), start = "2015-01-01", end = "2015-01-15", interval = "month")
  9: weather_format(w = w, preamble = preamble, stations = stations, interval = interval, 
         tz_disp = tz_disp, string_as = string_as, quiet = quiet)
  10: apply(w[, !(names(w) %in% c("date", "year", "month", "day", "hour", "time", "qual", 
         "weather", grep("flag", names(w), value = TRUE)))], MARGIN = 2, FUN = function(x) tryCatch(as.numeric(x), 
         warning = function(w) w))
  11: FUN(newX[, i], ...)
  12: tryCatch(as.numeric(x), warning = function(w) w)
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  15: doTryCatch(return(expr), name, parentenv, handler)
  
  ── 36. Failure: weather_dl() hour format = FALSE (@test_07_weather_args.R#11)  ─
  `w` has length 36, not length 34.
  
  ── 37. Failure: weather_dl() hour format = FALSE (@test_07_weather_args.R#16)  ─
  all(apply(c, 2, is.character)) isn't true.
  
  ── 38. Failure: weather_dl() day format = FALSE (@test_07_weather_args.R#34)  ──
  `w` has length 39, not length 37.
  
  ── 39. Failure: weather_dl() day format = FALSE (@test_07_weather_args.R#39)  ──
  all(apply(c, 2, is.character)) isn't true.
  
  ── 40. Failure: weather_dl() month format = FALSE (@test_07_weather_args.R#60)  
  `w` has length 37, not length 35.
  
  ── 41. Failure: weather_dl() month format = FALSE (@test_07_weather_args.R#65)  
  all(apply(c, 2, is.character)) isn't true.
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 291 | SKIPPED: 4 | WARNINGS: 0 | FAILED: 41 ]
  1. Error: weather (hour) returns a data frame (@test_06_weather_dl.R#6) 
  2. Error: weather (hour) formats timezone display (@test_06_weather_dl.R#34) 
  3. Error: weather (hour) formats timezone to UTC with multiple zones (@test_06_weather_dl.R#44) 
  4. Error: weather (hour) gets all (@test_06_weather_dl.R#61) 
  5. Error: weather (hour) trims NAs (@test_06_weather_dl.R#73) 
  6. Error: weather (hour) multiple stations (@test_06_weather_dl.R#80) 
  7. Error: weather (hour) no data fails nicely (@test_06_weather_dl.R#95) 
  8. Error: weather (hour) verbose and quiet (@test_06_weather_dl.R#134) 
  9. Error: weather (hour) handles data with different numbers of columns (@test_06_weather_dl.R#149) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted