| get_chunk {disk.frame} | R Documentation |
Obtain one chunk by chunk id
get_chunk(...) ## S3 method for class 'disk.frame' get_chunk(df, n, keep = NULL, full.names = FALSE, ...)
... |
passed to fst::read_fst or whichever read function is used in the backend |
df |
a disk.frame |
n |
the chunk id. If numeric then matches by number, if character then returns the chunk with the same name as n |
keep |
the columns to keep |
full.names |
whether n is the full path to the chunks or just a relative path file name. Ignored if n is numeric |
cars.df = as.disk.frame(cars, nchunks = 2) get_chunk(cars.df, 1) get_chunk(cars.df, 2) get_chunk(cars.df, 1, keep = "speed") # if full.names = TRUE then the full path to the chunk need to be provided get_chunk(cars.df, file.path(attr(cars.df, "path"), "1.fst"), full.names = TRUE) # clean up cars.df delete(cars.df)