R/kable_xml.R

Defines functions xml_as_kable kable_as_xml

Documented in kable_as_xml xml_as_kable

#' Read HTML kable as XML
#'
#' @description This function will read kable as a xml file
#'
#' @param x kable or kableExtra object
#'
#' @export
kable_as_xml <- function(x) {
  read_kable_as_xml(x)$table
}

#' Convert XML back to kable
#'
#' @description Convert XML back to kable
#'
#' @param x XML table object
#'
#' @export
xml_as_kable <- function(x) {
  out <- as_kable_xml(x)
  class(out) <- "kableExtra"
  return(out)
}

Try the kableExtra package in your browser

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

kableExtra documentation built on June 22, 2024, 10:59 a.m.