Running ‘testthat.R’ [10m/11m]
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)
  
  Killed