R/tab2df.R

Defines functions tab2df

Documented in tab2df

#' Table to Data Frame
#'
#' Convert table (including xtabs) to data frame.
#'
#' @param x a table.
#'
#' @return Data frame with same data as \code{x}.
#'
#' @importFrom utils type.convert
#'
#' @export

tab2df <- function(x)
{
  as.data.frame(unclass(x), row.names=type.convert(row.names(x), as.is=TRUE))
}
arnima-github/arni documentation built on Oct. 28, 2023, 6:18 p.m.