get_chunk | 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, ..., partitioned_info = NULL)
... |
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 |
partitioned_info |
for internal use only. It's a data.frame used to help with filtering by partitions |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.