R/quickdf.R

Defines functions quickdf

Documented in quickdf

#' @title Quick Data Frame
#' @description Speedups in data.frame creation.
#' @param x named list of equal length vectors
#' @return data.frame
#' @details This is 20x faster than as.data.frame.
#' @references Idea borrowed from \url{http://adv-r.had.co.nz/Profiling.html}.
#' @author HW/LL
#' @keywords internal
#' @export
quickdf <- function(x) {
  class(x) <- "data.frame"
  attr(x, "row.names") <- .set_row_names(length(x[[1]]))
  x
}

Try the hetu package in your browser

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

hetu documentation built on May 22, 2022, 1:05 a.m.