Running 'forestplot2_vtests.R' [3s]
  Running 'test_visual_w_cochrane_mdata.R' [1s]
  Running 'test_visual_with_Greg.R' [166s]
  Running 'testthat.R' [3s]
  Running 'vtest_from_vignette.R' [159s]
Running the tests in 'tests/test_visual_with_Greg.R' failed.
Complete output:
  > library(Greg)
  Loading required package: Gmisc
  Loading required package: Rcpp
  Loading required package: htmlTable
  Loading required package: forestplot
  Loading required package: grid
  Loading required package: checkmate
  Loading required package: abind
  > library(tidyverse)
  ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
  ✔ dplyr     1.1.4     ✔ readr     2.1.5
  ✔ forcats   1.0.0     ✔ stringr   1.5.1
  ✔ ggplot2   3.5.0     ✔ tibble    3.2.1
  ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
  ✔ purrr     1.0.2     
  ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
  ✖ dplyr::filter() masks stats::filter()
  ✖ dplyr::lag()    masks stats::lag()
  ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
  > # simulated data to test
  > set.seed(102)
  > cov <- tibble(ftime = rexp(200)) |>
  +   mutate(x1 = runif(n()),
  +          x2 = runif(n()),
  +          x3 = runif(n()),
  +          fstatus1 = if_else(x1 * 1 +
  +                               x2 * 0.2 +
  +                               x3 * 0.5 +
  +                               runif(n()) * 0.5 > 1,
  +                             1, 0),
  +          fstatus2 = if_else(x1 * 0.2 +
  +                               x2 * 0.5 +
  +                               x3 * 0.1 +
  +                               runif(n()) * 2 > 1,
  +                             1, 0)) |>
  +   # Add some column labels
  +   Gmisc::set_column_labels(x1 = "First variable",
  +                            x2 = "Second variable")
  > 
  > library(rms)
  Loading required package: Hmisc
  
  Attaching package: 'Hmisc'
  
  The following objects are masked from 'package:dplyr':
  
      src, summarize
  
  The following objects are masked from 'package:base':
  
      format.pval, units
  
  > dd <- datadist(cov)
  > options(datadist = "dd")
  > 
  > fit1 <- cph(Surv(ftime, fstatus1 == 1) ~ x1 + x2 + x3, data = cov)
  > fit2 <- update(fit1, Surv(ftime, fstatus2 == 1) ~ .)
  > list("Frist model" = fit1, "Second model"  = fit2) |>
  +   forestplotRegrObj(legend_args = fpLegend(title = "Type of regression"),
  +                     postprocess_estimates.fn = \(x) filter(x, str_detect(column_term, "(x2|x3)")),
  +                     col = fpColors(box = c("darkblue", "darkred"))) |>
  +   fp_set_zebra_style("red")
  > 
  > proc.time()
     user  system elapsed 
     3.96    0.65    4.62 
Running the tests in 'tests/vtest_from_vignette.R' failed.
Complete output:
  > library(forestplot)
  Loading required package: grid
  Loading required package: checkmate
  Loading required package: abind
  > options(forestplot_new_page = TRUE)
  > # Cochrane data from the 'rmeta'-package
  > cochrane_from_rmeta <-
  +   structure(list(
  +     mean  = c(NA, NA, 0.578, 0.165, 0.246, 0.700, 0.348, 0.139, 1.017, NA, 0.531),
  +     lower = c(NA, NA, 0.372, 0.018, 0.072, 0.333, 0.083, 0.016, 0.365, NA, 0.386),
  +     upper = c(NA, NA, 0.898, 1.517, 0.833, 1.474, 1.455, 1.209, 2.831, NA, 0.731)
  +   ),
  +   .Names = c("mean", "lower", "upper"),
  +   row.names = c(NA, -11L),
  +   class = "data.frame"
  +   )
  > 
  > tabletext <- cbind(
  +   c(
  +     "", "Study", "Auckland", "Block",
  +     "Doran", "Gamsu", "Morrison", "Papageorgiou",
  +     "Tauesch", NA, "Summary"
  +   ),
  +   c(
  +     "Deaths", "(steroid)", "36", "1",
  +     "4", "14", "3", "1",
  +     "8", NA, NA
  +   ),
  +   c(
  +     "Deaths", "(placebo)", "60", "5",
  +     "11", "20", "7", "7",
  +     "10", NA, NA
  +   ),
  +   c(
  +     "", "OR", "0.58", "0.16",
  +     "0.25", "0.70", "0.35", "0.14",
  +     "1.02", NA, "0.53"
  +   )
  + )
  > 
  > # Test summary
  > forestplot(tabletext,
  +            cochrane_from_rmeta,
  +            new_page = TRUE,
  +            is.summary = c(TRUE, TRUE, rep(FALSE, 8), TRUE),
  +            clip = c(0.1, 2.5),
  +            xlog = TRUE,
  +            col = fpColors(box = "royalblue", line = "darkblue", summary = "royalblue"))
  > 
  > # Test lines
  > forestplot(tabletext,
  +   hrzl_lines = gpar(col = "#444444"),
  +   cochrane_from_rmeta, new_page = TRUE,
  +   is.summary = c(TRUE, TRUE, rep(FALSE, 8), TRUE),
  +   clip = c(0.1, 2.5),
  +   xlog = TRUE,
  +   col = fpColors(box = "royalblue", line = "darkblue", summary = "royalblue")
  + )
  > 
  > # Test line options
  > forestplot(tabletext,
  +   hrzl_lines = list(
  +     "3" = gpar(lty = 2),
  +     "11" = gpar(lwd = 1, columns = 1:4, col = "#000044")
  +   ),
  +   cochrane_from_rmeta, new_page = TRUE,
  +   is.summary = c(TRUE, TRUE, rep(FALSE, 8), TRUE),
  +   clip = c(0.1, 2.5),
  +   xlog = TRUE,
  +   col = fpColors(box = "royalblue", line = "darkblue", summary = "royalblue", hrz_lines = "#444444")
  + )
  > 
  > # Test colors
  > forestplot(tabletext,
  +   hrzl_lines = list(
  +     "3" = gpar(lty = 2),
  +     "11" = gpar(lwd = 1, columns = 1:4, col = "blue")
  +   ),
  +   cochrane_from_rmeta, new_page = TRUE,
  +   is.summary = c(TRUE, TRUE, rep(FALSE, 8), TRUE),
  +   clip = c(0.1, 2.5),
  +   xlog = TRUE,
  +   col = fpColors(box = "red", line = "green", summary = "purple", hrz_lines = "orange"),
  +   vertices = TRUE
  + )
  > 
  > # Test positioning of text
  > forestplot(tabletext,
  +   graph.pos = 4,
  +   hrzl_lines = list(
  +     "3" = gpar(lty = 2),
  +     "11" = gpar(lwd = 1, columns = c(1:3, 5), col = "#000044"),
  +     "12" = gpar(lwd = 1, lty = 2, columns = c(1:3, 5), col = "#000044")
  +   ),
  +   cochrane_from_rmeta, new_page = TRUE,
  +   is.summary = c(TRUE, TRUE, rep(FALSE, 8), TRUE),
  +   clip = c(0.1, 2.5),
  +   xlog = TRUE,
  +   col = fpColors(box = "royalblue", line = "darkblue", summary = "royalblue", hrz_lines = "#444444")
  + )
  > 
  > # Test expression
  > data(HRQoL)
  > clrs <- fpColors(box = "royalblue", line = "darkblue", summary = "royalblue")
  > tabletext <-
  +   list(
  +     c(NA, rownames(HRQoL$Sweden)),
  +     append(list(expression(beta)), sprintf("%.2f", HRQoL$Sweden[, "coef"]))
  +   )
  > forestplot(tabletext,
  +   rbind(
  +     rep(NA, 3),
  +     HRQoL$Sweden
  +   ),
  +   col = clrs,
  +   xlab = "EQ-5D index"
  + )
  > 
  > # Test alternative text
  > tabletext <- cbind(
  +   rownames(HRQoL$Sweden),
  +   sprintf("%.2f", HRQoL$Sweden[, "coef"])
  + )
  > forestplot(tabletext,
  +   txt_gp = fpTxtGp(label = gpar(fontfamily = "HersheyScript")),
  +   rbind(HRQoL$Sweden),
  +   col = clrs,
  +   xlab = "EQ-5D index"
  + )
  > 
  > # More color tests
  > forestplot(tabletext,
  +   txt_gp = fpTxtGp(
  +     label = list(
  +       gpar(fontfamily = "HersheyScript"),
  +       gpar(
  +         fontfamily = "",
  +         col = "#660000"
  +       )
  +     ),
  +     ticks = gpar(fontfamily = "", cex = 1),
  +     xlab = gpar(fontfamily = "HersheySerif", cex = 1.5)
  +   ),
  +   rbind(HRQoL$Sweden),
  +   col = clrs,
  +   xlab = "EQ-5D index"
  + )
  > 
  > # Test clipping
  > forestplot(tabletext,
  +   rbind(HRQoL$Sweden),
  +   clip = c(-.1, Inf),
  +   col = clrs,
  +   xlab = "EQ-5D index"
  + )
  > 
  > # test two lines
  > tabletext <- tabletext[, 1]
  > forestplot(tabletext,
  +            mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +            lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +            upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +            clip = c(-.1, 0.075),
  +            col = fpColors(box = c("blue", "darkred")),
  +            xlab = "EQ-5D index")
  > 
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +   fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +   boxsize = .25, # We set the box size to better visualize the type
  +   line.margin = .1, # We need to add this to avoid crowding
  +   mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +   lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +   upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +   clip = c(-.125, 0.075),
  +   col = fpColors(box = c("blue", "darkred")),
  +   xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +   fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +   boxsize = .25, # We set the box size to better visualize the type
  +   line.margin = .1, # We need to add this to avoid crowding
  +   mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +   lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +   upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +   clip = c(-.125, 0.075),
  +   lty.ci = c(1, 2),
  +   col = fpColors(box = c("blue", "darkred")),
  +   xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +   legend = c("Sweden", "Denmark"),
  +   fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +   boxsize = .25, # We set the box size to better visualize the type
  +   line.margin = .1, # We need to add this to avoid crowding
  +   mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +   lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +   upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +   clip = c(-.125, 0.075),
  +   col = fpColors(box = c("blue", "darkred")),
  +   xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +   legend_args = fpLegend(
  +     pos = list(x = .85, y = 0.25),
  +     gp = gpar(col = "#CCCCCC", fill = "#F9F9F9")
  +   ),
  +   legend = c("Sweden", "Denmark"),
  +   fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +   boxsize = .25, # We set the box size to better visualize the type
  +   line.margin = .1, # We need to add this to avoid crowding
  +   mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +   lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +   upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +   clip = c(-.125, 0.075),
  +   col = fpColors(box = c("blue", "darkred")),
  +   xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +   legend = c("Sweden", "Denmark"),
  +   fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +   boxsize = .25, # We set the box size to better visualize the type
  +   line.margin = .1, # We need to add this to avoid crowding
  +   mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +   lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +   upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +   clip = c(-.125, 0.075),
  +   col = fpColors(box = c("blue", "darkred")),
  +   xticks = c(-.1, -0.05, 0, .05),
  +   xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > xticks <- seq(from = -.1, to = .05, by = 0.025)
  > xtlab <- rep(c(TRUE, FALSE), length.out = length(xticks))
  > attr(xticks, "labels") <- xtlab
  > forestplot(tabletext,
  +            legend = c("Sweden", "Denmark"),
  +            fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +            boxsize = .25, # We set the box size to better visualize the type
  +            line.margin = .1, # We need to add this to avoid crowding
  +            mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +            lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +            upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +            clip = c(-.125, 0.075),
  +            col = fpColors(box = c("blue", "darkred")),
  +            xticks = xticks,
  +            xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +            legend = c("Sweden", "Denmark"),
  +            fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +            boxsize = .25, # We set the box size to better visualize the type
  +            line.margin = .1, # We need to add this to avoid crowding
  +            mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +            lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +            upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +            clip = c(-.125, 0.075),
  +            col = fpColors(box = c("blue", "darkred")),
  +            grid = TRUE,
  +            xticks = c(-.1, -0.05, 0, .05),
  +            xlab = "EQ-5D index"
  + )
  > 
  > ## ------------------------------------------------------------------------
  > forestplot(tabletext,
  +            legend = c("Sweden", "Denmark"),
  +            fn.ci_norm = c(fpDrawNormalCI, fpDrawCircleCI),
  +            boxsize = .25, # We set the box size to better visualize the type
  +            line.margin = .1, # We need to add this to avoid crowding
  +            mean = cbind(HRQoL$Sweden[, "coef"], HRQoL$Denmark[, "coef"]),
  +            lower = cbind(HRQoL$Sweden[, "lower"], HRQoL$Denmark[, "lower"]),
  +            upper = cbind(HRQoL$Sweden[, "upper"], HRQoL$Denmark[, "upper"]),
  +            clip = c(-.125, 0.075),
  +            col = fpColors(box = c("blue", "darkred")),
  +            grid = structure(c(-.1, -.05, .05),
  +                             gp = gpar(lty = 2, col = "#CCCCFF")
  +            ),
  +            xlab = "EQ-5D index"
  + )
  > 
  > ## ---- eval=FALSE, echo=TRUE----------------------------------------------
  > #  grid_arg <- c(-.1, -.05, .05)
  > #  attr(grid_arg, "gp") <- gpar(lty = 2, col = "#CCCCFF")
  > #
  > #  identical(grid_arg,
  > #            structure(c(-.1, -.05, .05),
  > #                      gp = gpar(lty = 2, col = "#CCCCFF")))
  > #  # Returns TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.34    0.09    1.42