R/coerce.R

Defines functions as.data.frame.DiversityIndex

# COERCION
#' @include AllGenerics.R AllClasses.R
NULL

# To data.frame ================================================================
#' @method as.data.frame DiversityIndex
#' @export
as.data.frame.DiversityIndex <- function(x, ...) {
  data.frame(
    size = x@size,
    index = x@.Data,
    row.names = labels(x),
    stringsAsFactors = FALSE
  )
}

Try the tabula package in your browser

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

tabula documentation built on Aug. 22, 2023, 5:11 p.m.