R/head.R

Defines functions head.chunkwise

#' @export
#' @importFrom utils head
#' @inheritParams head
head.chunkwise <- function(x, n=6L, ...){
  stopifnot(length(n) == 1)
  res <- x$first_chunk(x$cmds)
  while(nrow(res) < n && !x$is_complete()){
    res <- rbind(res, x$next_chunk(x$cmd))
  }
  utils::head(res, n=n)
}

Try the chunked package in your browser

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

chunked documentation built on March 18, 2022, 6:04 p.m.