Learn R Programming

disk.frame (version 0.1.0)

write_disk.frame: Write disk.frame to disk

Description

Write a data.frame/disk.frame to a disk.frame location. If df is a data.frame, then df must contain the column .out.disk.frame.id. This is intended to be a low-level version of writing disk.frames. Using the as.disk.frame function is recommended for most cases

Usage

write_disk.frame(df, outdir = tempfile(fileext = ".df"),
  nchunks = nchunks.disk.frame(df), overwrite = FALSE,
  shardby = NULL, compress = 50, ...)

output_disk.frame(...)

Arguments

df

a disk.frame

outdir

output directory for the disk.frame

nchunks

number of chunks

overwrite

overwrite output directory

shardby

the columns to shard by

compress

compression ratio for fst files

...

passed to map.disk.frame

Examples

Run this code
# NOT RUN {
cars.df = as.disk.frame(cars)

# write out a lazy disk.frame to disk
cars2.df = write_disk.frame(map(cars.df, ~.x[1,]), overwrite = TRUE)
collect(cars2.df)

# clean up cars.df
delete(cars.df)
delete(cars2.df)
# }

Run the code above in your browser using DataLab