* using log directory ‘/Users/ripley/R/packages/tests-devel/customLayout.Rcheck’ * using R Under development (unstable) (2021-01-19 r79848) * using platform: aarch64-apple-darwin20.2.0 (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘customLayout/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘customLayout’ version ‘0.3.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘customLayout’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(customLayout) > library(vdiffr) > > on_appveyor <- function() { + identical(Sys.getenv("APPVEYOR"), "True") + } > on_cran <- function() { + !identical(Sys.getenv("NOT_CRAN"), "true") + } > > # Use minimal fonts.conf to speed up fc-cache > if (on_appveyor() || on_cran()) { + gdtools::set_dummy_conf() + } NULL > > > test_phl_with_flextable <- function(seed = 123) { + lay <- lay_bind_row( + lay_new(1), + lay_new(cbind(1,2)), + heights = c(3, 2) + ) + olay <- phl_layout(lay) + + set.seed(seed) + + pptx <- officer::read_pptx() + pptx <- officer::add_slide( + pptx, + layout = "Two Content", master = "Office Theme") + + data("diamonds", package = "ggplot2") + diamonds2 <- diamonds[sample.int(nrow(diamonds), 100), ] + + tbl1 <- dplyr::group_by(diamonds2, cut) + tbl1 <- dplyr::summarise(tbl1, Price = mean(price)) + + t1 <- phl_adjust_table(tbl1, olay, 1) + t2 <- phl_adjust_table(tbl1, olay, 2) + t3 <- phl_adjust_table(tbl1, olay, 3) + + pptx <- phl_with_flextable(pptx, olay, 1, t1) + pptx <- phl_with_flextable(pptx, olay, 2, t2) + pptx <- phl_with_flextable(pptx, olay, 3, t3) + pptx + } > > > test_phl_with_vg <- function(seed = 123) { + lay <- lay_bind_row( + lay_new(1), + lay_new(cbind(1,2)), + heights = c(3, 2) + ) + olay <- phl_layout(lay) + + set.seed(seed) + + pptx <- officer::read_pptx() + pptx <- officer::add_slide(pptx, + layout = "Two Content", master = "Office Theme") + + phl_with_vg(pptx, olay, 1, code = { + plot(rnorm(10), rnorm(10)) + title("Title") + }) + + data("diamonds", package = "ggplot2") + diamonds2 <- diamonds[sample.int(nrow(diamonds), 100), ] + gg1 <- ggplot2::ggplot(diamonds2) + + ggplot2::geom_point(aes(carat, price)) + gg2 <- ggplot2::ggplot(diamonds2) + + ggplot2::geom_point(aes(depth, price)) + + phl_with_vg(pptx, olay, 2, ggobj = gg1) + phl_with_vg(pptx, olay, 3, ggobj = gg2) + pptx + } > > test_phl_with_gg <- function(seed = 123) { + lay <- lay_bind_row( + lay_new(1), + lay_new(cbind(1,2)), + heights = c(3, 2) + ) + olay <- phl_layout(lay) + + set.seed(seed) + + pptx <- officer::read_pptx() + pptx <- officer::add_slide(pptx, + layout = "Two Content", master = "Office Theme") + + data("diamonds", package = "ggplot2") + diamonds2 <- diamonds[sample.int(nrow(diamonds), 100), ] + + gg <- ggplot2::ggplot(diamonds2) + + ggplot2::geom_point(aes(x, price)) + + phl_with_gg(pptx, olay, 1, gg) + + gg1 <- ggplot2::ggplot(diamonds2) + + ggplot2::geom_point(aes(carat, price)) + gg2 <- ggplot2::ggplot(diamonds2) + + ggplot2::geom_point(aes(depth, price)) + + phl_with_gg(pptx, olay, 2, gg1) + phl_with_gg(pptx, olay, 3, gg2) + pptx + } > > test_phl_with_table <- function(seed = 123) { + + lay <- lay_bind_col( + lay_new(rbind(1,2)), + lay_new(rbind(1,2)), + widths = c(3,4) + ) + + olay <- phl_layout(lay) + + set.seed(seed) + + pptx <- officer::read_pptx() + pptx <- officer::add_slide( + pptx, + layout = "Two Content", master = "Office Theme") + + irs <- iris[sample.int(nrow(iris), 10), ] + + pptx <- phl_with_table(pptx, olay, 1, head(irs,3)) + pptx <- phl_with_table(pptx, olay, 2, head(irs,4)) + pptx <- phl_with_table(pptx, olay, 3, head(irs[,c(1,5)],3)) + pptx <- phl_with_table(pptx, olay, 4, head(irs[,c(1,5)],4)) + pptx + } > > test_phl_with_flextable_large_tables_warns <- function(seed = 123) { + + lay <- lay_bind_col( + lay_new(rbind(1,2)), + lay_new(rbind(1,2)) + ) + + olay <- phl_layout(lay) + + set.seed(seed) + + pptx <- officer::read_pptx() + pptx <- officer::add_slide( + pptx, + layout = "Two Content", master = "Office Theme") + + irs <- iris[sample.int(nrow(iris), 10), ] + + tbl1 <- phl_adjust_table(irs, olay, 1) + tbl2 <- phl_adjust_table(irs, olay, 2, method = "height") + tbl3 <- phl_adjust_table(irs, olay, 3) + tbl4 <- flextable::flextable(irs) + tbl4 <- flextable::height_all(tbl4, tbl3$header$rowheights * 1.5) + tbl4 <- flextable::width(tbl4, width = tbl4$body$colwidths * 1.5) + + + phl_with_flextable(pptx, olay, 1, tbl1) + phl_with_flextable(pptx, olay, 2, tbl2) + phl_with_flextable(pptx, olay, 3, tbl3) + phl_with_flextable(pptx, olay, 4, tbl4) + pptx + } > > # print(test_phl_with_flextable(), "tests/pptx/phl_with_flextable.pptx") > # print(test_phl_with_flextable_large_tables_warns(), "tests/pptx/test_phl_with_flextable_large_tables_warns.pptx") > # print(test_phl_with_gg(), "tests/pptx/phl_with_gg.pptx") > # print(test_phl_with_table(), "tests/pptx/test_phl_with_table.pptx") > # print(test_phl_with_vg(), "tests/pptx/phl_with_vg.pptx") > > test_check("customLayout") ══ Skipped tests ═══════════════════════════════════════════════════════════════ ● On CRAN (5) ● Skipping on CRAN (9) ● This can only pass on linux (1) ● empty test (3) ══ Warnings ════════════════════════════════════════════════════════════════════ ── Warning (test-officer.R:50:3): phl_with_plot works ────────────────────────── type = "cairo" is unavailable. trying "Xlib" Backtrace: 1. customLayout::phl_with_plot(pptx, offLayout, 7, pl7) test-officer.R:50:2 2. grDevices::png(...) ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error (test-officer.R:50:3): phl_with_plot works ──────────────────────────── Error: src must be a string starting with 'rId' or an image filename Backtrace: █ 1. └─customLayout::phl_with_plot(pptx, offLayout, 7, pl7) test-officer.R:50:2 2. ├─officer::ph_with(...) 3. └─officer::external_img(src = file) [ FAIL 1 | WARN 1 | SKIP 18 | PASS 15 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... WARNING Error(s) in re-building vignettes: --- re-building ‘Roadmap.Rmd’ using rmarkdown --- finished re-building ‘Roadmap.Rmd’ --- re-building ‘customlayout-cookbook.Rmd’ using rmarkdown Loading required package: MASS --- finished re-building ‘customlayout-cookbook.Rmd’ --- re-building ‘layouts-for-officer-power-point-document.Rmd’ using rmarkdown Quitting from lines 75-91 (layouts-for-officer-power-point-document.Rmd) Error: processing vignette 'layouts-for-officer-power-point-document.Rmd' failed with diagnostics: src must be a string starting with 'rId' or an image filename --- failed re-building ‘layouts-for-officer-power-point-document.Rmd’ SUMMARY: processing the following file failed: ‘layouts-for-officer-power-point-document.Rmd’ Error: Vignette re-building failed. Execution halted * checking PDF version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 1 WARNING See ‘/Users/ripley/R/packages/tests-devel/customLayout.Rcheck/00check.log’ for details. 32.86 real 21.22 user 5.08 sys