R6 class implementing fast random access to zip files.
R6 class implementing fast random access to zip files.
zipfile
the path to the zip file
new()
Initialise an RAZip object
RAZip$new(zipfile, unserialize = NULL)
zipfile
path to the zip file
unserialize
Optional function to be applied to raw bytes from the
zip file. When missing R's unserialize
or qs::deserialize
is used.
getbytes()
read raw bytes for a zip entry
RAZip$getbytes(f)
f
A file inside the zip to read.
get()
read an R object from a zip entry
RAZip$get(f)
f
A file inside the zip to read.
mget()
read multiple R objects from a zip file
RAZip$mget(f, ...)
f
One or more files inside the zip to read
...
additional arguments passed to pbapply::pbsapply
A named list
ziplist()
Return the zip info from zip::zip_list
RAZip$ziplist()
A named list
clone()
The objects of this class are cloneable with this method.
RAZip$clone(deep = FALSE)
deep
Whether to make a deep clone.
#> RAZip object wrapping: /Users/runner/work/_temp/Library/razip/sampledata/Cell07PNs-rds.zip which contains 5 files.# } if (FALSE) { raz=RAZip$new("~/Desktop/flywire_neurons_flow_FlyWireqs.zip") raz zl=raz$ziplist() bench::mark(s1=raz$get(sample(zl$filename, 1)), check = F) }