R/read_part.R

Defines functions read_part

#' @export
read_part <- function(x, n = 1, ...){
  if (!is.fstparts(x)){
    stop("x must be a 'fstparts' object")
  }
  if (n > length(x$parts) || n < 1){
    stop("the number of parts is maximally ", length(x$parts))
  }
  fst::read.fst( path = file.path(x$dir, x$parts[[n]]$name)
               , ...
               )
}
# 
# x <- fstparts(iris, dir=tempfile())
# x
# n <- 1
# 
# read_part(x)
edwindj/fstparts documentation built on Aug. 9, 2019, 6:10 p.m.