Running ‘testthat.R’ [5s/29s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("rdefra")
  > 
  > test_check("rdefra")
  Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
    more columns than column names
  ── 1. Error: Metadata should be in the right format (@test-data.R#39)  ─────────
  arguments imply differing number of rows: 0, 1
  1: ukair_get_hourly_data(site_id, years) at testthat/test-data.R:39
  2: ukair_get_hourly_data_internal(site_id, myYear)
  3: data.frame(variable = names(df)[col_vars], unit = units_col, year = a_year, stringsAsFactors = FALSE)
  4: stop(gettextf("arguments imply differing number of rows: %s", paste(unique(nrows), 
         collapse = ", ")), domain = NA)
  
  Error in type.convert.default(data[[i]], as.is = as.is[i], dec = dec,  : 
    invalid multibyte string at '<a9><ff>*<e8>:Y<9a><ab><bd>5<cd>Y<83><d3>#<c7>6R<88><88>1a_<d2>0~<cd>'$<a1>*<b7><9e>ECX?@C>$5<d0>U<cf>.<c6>c<c5><e0><f7>]<e3>7<8a><ea>@<90>A&<c0>;'
  ── 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 838 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: 10 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