-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for writing multiple files to zip/tar #203
Comments
The problem with exporting to .zip is not reproducible for me. I would guess you do not have a zip tool installed on your system. See The second issue about writing multiple files to a zip or tar is a good idea but it's not currently supported. I'll add it to the wishlist. |
Thanks for your reply. |
I'm going to reopen as a reminder to work on writing multiple files to zip/tar. Thanks again. |
Brainstorming ideas on how to implement this: export_list(list(
mtcars1 = mtcars[1:10, ],
mtcars2 = mtcars[11:20, ],
mtcars3 = mtcars[21:32, ]
), file = c("file1.csv", "file2.csv", "file3.csv"), compress = "data.zip") Adds a new parameter. My first that ws to make this TRUE/FALSE, but we need to get the zip file name somehow (or we default to something like data.zip, which i do not think is a good idea.) Could, if needed, be extended to also write to directories:
AFAIS this does not require too much changes in the code. Doesn't add a new parameter. Instead, the zip file name is appended to the file list. export_list(list(
mtcars1 = mtcars[1:10, ],
mtcars2 = mtcars[11:20, ],
mtcars3 = mtcars[21:32, ]
), file = c("file1.csv", "file2.csv", "file3.csv","data.zip")) I think this would also not require too many changes |
@schochastics I like the first idea better (adding a new parameter). Referencing the relevant functions (e.g. |
@chainsawriot ok sounds good. Should |
I think directory is also a good idea. If it is the case, the argument is not always a file. Maybe just archive = NULL # just dump all files to the current directory
archive = "~/directory" #dump to this directory
archive = "~/all_my_illegal_bibcoin_transactions.zip"`
archive = "./I_think_windows_users_dont_use.tar"` |
Here are two reproducible examples.
zip
.data.frame
exporting is supported in the formatxlsx
, instead oftar
. In the future, any chance to add this feature. I am not sure, but in my daily work, it is often to compress a couple of files in a zip file.Created on 2019-03-21 by the reprex package (v0.2.1)
Session info
Created on 2019-03-21 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: