if (outputSlot != "SummaryTable") {
  stop("Not a table result")
}
all_res <- current_results[resp_vars == variable]
if (!chunk_error) {
  all_res <- all_res[(vapply(all_res, length, FUN.VALUE = integer(1)) > 0)]
}
have_a_result <- length(all_res) > 0
if (!have_a_result) {
  stop("No results here")
}
cat(sprintf(title, dQuote(dataquieR::prep_title_escape(variable, html = FALSE))))
cat("\n")
for (x in all_res) {
  if (length(attr(x, "message")) > 0) {
    for (m in attr(x, "message"))
      message(m)
  }
  if (length(attr(x, "warning")) > 0) {
    for (w in attr(x, "warning"))
      warning(w)
  }
  error_shown <- FALSE
  if (length(attr(x, "error")) > 0) {
    e <- attr(x, "error")[[1]]
    try(stop(e))
    error_shown <- TRUE
  }
  attr(x, "message") <- NULL
  attr(x, "warning") <- NULL
  attr(x, "error") <- NULL
  class(x) <- setdiff(class(x), 'dataquieR_result')
}
 util_html_table(x[[outputSlot]], rotate_headers = TRUE, output_format = "RMD")


Try the dataquieR package in your browser

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

dataquieR documentation built on July 26, 2023, 6:10 p.m.