`zip_to_disk.frame` is used to read and convert every CSV file within the zip file to disk.frame format

zip_to_disk.frame(
  zipfile,
  outdir,
  ...,
  validation.check = FALSE,
  overwrite = TRUE
)

Arguments

zipfile

The zipfile

outdir

The output directory for disk.frame

...

passed to fread

validation.check

should the function perform a check at the end to check for validity of output. It can detect issues with conversion

overwrite

overwrite output directory

Value

a list of disk.frame

See also

Other ingesting data: csv_to_disk.frame()

Examples

# create a zip file containing a csv
csvfile = tempfile(fileext = ".csv")
write.csv(cars, csvfile)
zipfile = tempfile(fileext = ".zip")
zip(zipfile, csvfile)
#> Warning: '"zip"' not found

# read every file and convert it to a disk.frame
zip.df = zip_to_disk.frame(zipfile, tempfile(fileext = ".df"))
#> Error in unzip(zipfile, list = TRUE): zip file 'C:\Users\RTX2080\AppData\Local\Temp\RtmpCo1OFr\file2b64e7c483a.zip' cannot be opened

# there is only one csv file so it return a list of one disk.frame
zip.df[[1]]
#> Error in eval(expr, envir, enclos): object 'zip.df' not found

# clean up
unlink(csvfile)
unlink(zipfile)
delete(zip.df[[1]])
#> Error in "disk.frame" %in% class(df): object 'zip.df' not found