Description Usage Arguments Details Value See Also
Read in all files contained in a zip file
1 2 |
zipfile |
name and path of a zip file containing files to read in |
pattern |
regular expression indicating the file extensions to be read. Default is .csv files |
SIMPLIFY |
logical, compress the contents into 2 data.table on output? To be safe, set FALSE |
use.fwf |
logical, indicating whether or not to read in as fixed width file; is overridden if file extensions are .fwf |
... |
other arguments to be passed on; in particular, the |
The function works by unzipping a file into a temporary directory, reading in all the files in that temporarily unzipped folder, and then deleting the temporary folder and all of its contents. Thus, is a handy way of keep all of your files stored as compressed files, but being able to access them. Obviously comes at the performance cost of having to do all of the unzipping and deleting.
No longer uses data.table's fread
because of a long-standing issue with quoted elements (comment fields in raw data files often have strange characters); now using read.csv
. For .fwf formats fread.fwf
is used.
a data.table, or list of data.tables. The name of each element of the list is the name of the file within the .zip file.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.