tests/testthat/helper-script.R

capture.kable <- function(x)
{
  y <- capture.output(x)
  stopifnot(length(y) > 3)
  if(grepl("^Table:", y[2])) y <- c("", y)
  if(y[1] != "" || y[2] != "" || tail(y, 1) != "") stop("Leading and/or trailing elements aren't blank")
  utils::head(utils::tail(y, -2), -1)
}

Try the arsenal package in your browser

Any scripts or data that you put into this service are public.

arsenal documentation built on June 5, 2021, 1:06 a.m.