Running ‘testthat.R’ [3s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(dhlabR)
  > 
  > test_check("dhlabR")
  [ FAIL 13 | WARN 1 | SKIP 0 | PASS 1 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_collocations.R:3:3'): get_collocations returns a data frame ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_document_corpus(doctype = "digibok") at test-get_collocations.R:3:3
   2.   ├─base::as.data.frame(do.call(cbind, content(query)))
   3.   ├─base::do.call(cbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_concordance.R:3:3'): get_concordance returns a valid dataframe ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_document_corpus(doctype = "digibok") at test-get_concordance.R:3:3
   2.   ├─base::as.data.frame(do.call(cbind, content(query)))
   3.   ├─base::do.call(cbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_dispersion.R:14:3'): get_dispersion returns expected result for known input ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_dispersion(urn, words, window, pr) at test-get_dispersion.R:14:3
   2.   ├─base::as.data.frame(do.call(rbind, content(query)))
   3.   ├─base::do.call(rbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_document_corpus.R:3:3'): get_document_corpus returns expected results ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_document_corpus() at test-get_document_corpus.R:3:3
   2.   ├─base::as.data.frame(do.call(cbind, content(query)))
   3.   ├─base::do.call(cbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_document_frequencies.R:3:3'): get_document_frequencies returns a valid dataframe ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_document_corpus(doctype = "digibok") at test-get_document_frequencies.R:3:3
   2.   ├─base::as.data.frame(do.call(cbind, content(query)))
   3.   ├─base::do.call(cbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_metadata.R:7:3'): get_metadata returns a dataframe with expected columns ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_metadata(dhlabids = test_dhlabids) at test-get_metadata.R:7:3
   2.   ├─base::do.call(cbind, content(query))
   3.   └─httr::content(query)
   4.     └─httr:::parse_auto(raw, type, encoding, ...)
   5.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   6.         └─httr:::need_package("xml2")
  ── Error ('test-get_ngram_from_book.R:2:3'): function returns a data frame ─────
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_ngram_from_books() at test-get_ngram_from_book.R:2:3
   2.   ├─utils::stack(content(query))
   3.   └─httr::content(query)
   4.     └─httr:::parse_auto(raw, type, encoding, ...)
   5.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   6.         └─httr:::need_package("xml2")
  ── Error ('test-get_ngram_from_book.R:7:3'): function returns a data frame with the correct columns ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_ngram_from_books() at test-get_ngram_from_book.R:7:3
   2.   ├─utils::stack(content(query))
   3.   └─httr::content(query)
   4.     └─httr:::parse_auto(raw, type, encoding, ...)
   5.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   6.         └─httr:::need_package("xml2")
  ── Error ('test-get_ngram_from_newspapers.R:2:3'): function returns a data frame ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_ngram_from_newspapers() at test-get_ngram_from_newspapers.R:2:3
   2.   ├─utils::stack(content(query))
   3.   └─httr::content(query)
   4.     └─httr:::parse_auto(raw, type, encoding, ...)
   5.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   6.         └─httr:::need_package("xml2")
  ── Error ('test-get_ngram_from_newspapers.R:7:3'): function returns a data frame with the correct columns ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_ngram_from_newspapers() at test-get_ngram_from_newspapers.R:7:3
   2.   ├─utils::stack(content(query))
   3.   └─httr::content(query)
   4.     └─httr:::parse_auto(raw, type, encoding, ...)
   5.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   6.         └─httr:::need_package("xml2")
  ── Error ('test-get_reference_words.R:9:3'): get_reference_words returns a valid list ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_reference_words(doctype, from_year, to_year, words) at test-get_reference_words.R:9:3
   2.   └─httr::content(query)
   3.     └─httr:::parse_auto(raw, type, encoding, ...)
   4.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   5.         └─httr:::need_package("xml2")
  ── Error ('test-get_urn_frequencies.R:7:3'): get_urn_frequencies works with a list of dhlabids ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_urn_frequencies(dhlabids = urn_list) at test-get_urn_frequencies.R:7:3
   2.   ├─base::as.data.frame(do.call(rbind, content(query)))
   3.   ├─base::do.call(rbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  ── Error ('test-get_urn_frequencies.R:19:3'): get_urn_frequencies works with a data frame of URNs ──
  Error: Please install xml2 package
  Backtrace:
      ▆
   1. └─dhlabR::get_document_corpus(doctype = "digibok") at test-get_urn_frequencies.R:19:3
   2.   ├─base::as.data.frame(do.call(cbind, content(query)))
   3.   ├─base::do.call(cbind, content(query))
   4.   └─httr::content(query)
   5.     └─httr:::parse_auto(raw, type, encoding, ...)
   6.       └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   7.         └─httr:::need_package("xml2")
  
  [ FAIL 13 | WARN 1 | SKIP 0 | PASS 1 ]
  Error: Test failures
  Execution halted