R/kableone.R

Defines functions kableone

Documented in kableone

#' Export TableOne Objects to Markdown
#'
#' @param x an object created by a tableone function
#' @param ... arguments passed to \code{\link[knitr]{kable}}
#'
#' @return A character vector of the table source code
#' @export
#'
#' @examples
#' 
#' library(survival)
#' data(pbc)
#' 
#' tableOne <- CreateTableOne(data = pbc)
#' 
#' kableone(tableOne)
#' 
#' @importFrom utils capture.output
kableone <- function(x, ...) {
  capture.output(x <- print(x, ...))
  knitr::kable(x, ...)
}

Try the tableone package in your browser

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

tableone documentation built on April 15, 2022, 5:06 p.m.