R/as-data-frame.R

Defines functions as.data.frame.ypr_ecotypes as.data.frame.ypr_populations as.data.frame.ypr_population

#' @export
as.data.frame.ypr_population <- function(x, ...) {
  chk_unused(...)
  x <- unclass(x)
  as.data.frame(x)
}

#' @export
as.data.frame.ypr_populations <- function(x, ...) {
  chk_unused(...)
  x <- lapply(x, as.data.frame)
  do.call("rbind", x)
}

#' @export
as.data.frame.ypr_ecotypes <- function(x, ...) {
  chk_unused(...)
  rname <- attr(x, "names")
  x <- lapply(x, as.data.frame)
  do.call("rbind", x)
}
poissonconsulting/ypr documentation built on April 4, 2023, 8:35 p.m.