Running ‘testthat.R’ [4s/31s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("rdefra")
  > 
  > test_check("rdefra")
  ── 1. Error: Metadata should be in the right format (@test-data.R#39)  ─────────
  input string 12 is invalid UTF-8
  1: ukair_get_hourly_data(site_id, years) at testthat/test-data.R:39
  2: ukair_get_hourly_data_internal(site_id, myYear)
  3: cbind(datetime = lubridate::dmy_hm(paste(df$Date, df$time, tz = "Europe/London")), 
         SiteID = site_id, df[, 3:dim(df)[2]])
  4: lubridate::dmy_hm(paste(df$Date, df$time, tz = "Europe/London"))
  5: .parse_xxx_hms(..., orders = "dmyR", quiet = quiet, tz = tz, locale = locale, truncated = truncated)
  6: parse_date_time(dates, orders, tz = tz, quiet = quiet, locale = locale)
  7: .local_parse(x[to_parse], TRUE)
  8: .local_parse(x)
  9: .best_formats(train, orders, locale = locale, select_formats, drop = drop)
  10: unique(guess_formats(x, orders, locale = locale, preproc_wday = TRUE))
  11: guess_formats(x, orders, locale = locale, preproc_wday = TRUE)
  12: gsub(reg$alpha_exact[["A"]], "%A", x, ignore.case = T, perl = T)
  
  Error in type.convert.default(data[[i]], as.is = as.is[i], dec = dec,  : 
    invalid multibyte string at '<c0><c1>C<f2>S<d6><4d><c9><8c>'
  ── 2. Failure: Data should be in the right format (@test-data.R#55)  ───────────
  `x` not equal to `expected`.
  'is.NA' value mismatch: 0 in current 1 in target
  
  ── 3. Error: Up-to-date metadata catalogue should have at least 6569 stations. (
  input string 599 is invalid UTF-8
  1: ukair_catalogue() at testthat/test-metadata.R:37
  2: data.frame(apply(df, 2, function(x) trimws(x)), stringsAsFactors = FALSE)
  3: apply(df, 2, function(x) trimws(x))
  4: FUN(newX[, i], ...)
  5: trimws(x)
  6: mysub(paste0(whitespace, "+$"), mysub(paste0("^", whitespace, "+"), x))
  7: sub(re, "", x, perl = TRUE)
  8: mysub(paste0("^", whitespace, "+"), x)
  9: sub(re, "", x, perl = TRUE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 17 SKIPPED: 1 WARNINGS: 13 FAILED: 3
  1. Error: Metadata should be in the right format (@test-data.R#39) 
  2. Failure: Data should be in the right format (@test-data.R#55) 
  3. Error: Up-to-date metadata catalogue should have at least 6569 stations. (@test-metadata.R#37) 
  
  Error: testthat unit tests failed
  Execution halted