-
Notifications
You must be signed in to change notification settings - Fork 77
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
export_list
only supports zip
#415
Labels
Comments
Line 6 in c86db70
.tar is promised in the doc. list_of_dfs <- list(mtcars1 = mtcars[1:10,], mtcars2 = mtcars[11:20,], mtcars3 = mtcars[21:32,])
rio::export_list(list_of_dfs, file = "%s.csv", archive = y <- tempfile(fileext = ".csv.tar"))
file.exists(y)
#> [1] TRUE
## not tar
rio::import(y)
#> Warning in system(cmd, intern = TRUE): running command '/bin/tar -tf
#> '/tmp/RtmpM28RL3/file95e0562dc0081.csv.tar'' had status 2
#> Warning in extract_func(file, files = file_list[which], exdir = d): '/bin/tar
#> -xf '/tmp/RtmpM28RL3/file95e0562dc0081.csv.tar' -C
#> '/tmp/RtmpM28RL3/file95e05708ea197' 'NA'' returned error code 2
#> Error: 'file' has no extension
## but
file.copy(y, z <- tempfile(fileext = ".csv.zip"))
#> [1] TRUE
rio::import(z, which = 1)
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> 1 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
#> 2 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
#> 3 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
#> 4 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
#> 5 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
#> 6 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1
#> 7 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4
#> 8 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2
#> 9 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2
#> 10 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4
##import(z, which = 2)
##import(z, which = 3) Created on 2024-05-15 with reprex v2.1.0 |
A short term solution is to clarify in the doc that only zip is supported. As a matter of fact, the corresponding Lines 120 to 132 in ca019c9
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This line uses the default format
rio/R/export_list.R
Line 71 in c86db70
rio/R/compression.R
Line 16 in c86db70
archive
should be checked for compression format.The text was updated successfully, but these errors were encountered: