Running ‘testthat.R’ [7s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(WordR)
  > 
  > test_check("WordR")
  ── 1. Error: addPlots (@tests.R#24)  ───────────────────────────────────────────
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
  1: expect_equal({
         library(ggplot2)
         Plots <- list(plot1 = function() plot(hp ~ wt, data = mtcars, col = cyl), plot2 = function() print(ggplot(mtcars, 
             aes(x = wt, y = hp, col = as.factor(cyl))) + geom_point()))
         addPlots(paste(examplePath(), "templates/templatePlots.docx", sep = ""), paste(tempdir(), 
             "/resultPlots.docx", sep = ""), Plots, debug = F, height = 4)
     }, paste(tempdir(), "/resultPlots.docx", sep = "")) at testthat/tests.R:24
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: addPlots(paste(examplePath(), "templates/templatePlots.docx", sep = ""), paste(tempdir(), 
         "/resultPlots.docx", sep = ""), Plots, debug = F, height = 4) at testthat/tests.R:25
  5: Plots[[bk]]()
  6: print(ggplot(mtcars, aes(x = wt, y = hp, col = as.factor(cyl))) + geom_point()) at testthat/tests.R:24
  7: print.ggplot(ggplot(mtcars, aes(x = wt, y = hp, col = as.factor(cyl))) + geom_point())
  8: ggplot_gtable(data)
  9: ggplot_gtable.ggplot_built(data)
  10: build_guides(plot$scales, plot$layers, plot$mapping, position, theme, plot$guides, 
         plot$labels)
  ...
  21: pushvpgp(x)
  22: pushgrobvp(x$vp)
  23: pushgrobvp.viewport(x$vp)
  24: pushViewport(vp, recording = FALSE)
  25: lapply(vps, push.vp, recording)
  26: FUN(X[[i]], ...)
  27: push.vp.vpTree(X[[i]], ...)
  28: push.vp(vp$parent, recording)
  29: push.vp.viewport(vp$parent, recording)
  30: grid.Call.graphics(C_setviewport, vp, TRUE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 2 SKIPPED: 0 FAILED: 1
  1. Error: addPlots (@tests.R#24) 
  
  Error: testthat unit tests failed
  Execution halted