Skip to content
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

Except csv.gz, no compression for .gz extensions #399

Closed
chainsawriot opened this issue Apr 26, 2024 · 1 comment
Closed

Except csv.gz, no compression for .gz extensions #399

chainsawriot opened this issue Apr 26, 2024 · 1 comment
Labels

Comments

@chainsawriot
Copy link
Collaborator

chainsawriot commented Apr 26, 2024

## fwrite can do this automatically, so this is a special case
R.utils::isGzipped(rio::export(iris, tempfile(fileext = ".csv.gz")), method = "content")
#> [1] TRUE

## But not this
R.utils::isGzipped(rio::export(iris, tempfile(fileext = ".ods.gz")), method = "content")
#> [1] FALSE

## It is still vanilla ODS; with no gz compression
readODS::read_ods(rio::export(iris, tempfile(fileext = ".ods.gz")))
#> # A tibble: 150 × 5
#>    Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#>           <dbl>       <dbl>        <dbl>       <dbl> <chr>  
#>  1          5.1         3.5          1.4         0.2 setosa 
#>  2          4.9         3            1.4         0.2 setosa 
#>  3          4.7         3.2          1.3         0.2 setosa 
#>  4          4.6         3.1          1.5         0.2 setosa 
#>  5          5           3.6          1.4         0.2 setosa 
#>  6          5.4         3.9          1.7         0.4 setosa 
#>  7          4.6         3.4          1.4         0.3 setosa 
#>  8          5           3.4          1.5         0.2 setosa 
#>  9          4.4         2.9          1.4         0.2 setosa 
#> 10          4.9         3.1          1.5         0.1 setosa 
#> # ℹ 140 more rows

Created on 2024-04-26 with reprex v2.1.0

@chainsawriot
Copy link
Collaborator Author

## work also
data.table::fwrite(iris, tmp <- tempfile(fileext = "csv.bz"))
data.table::fread(tmp)

TODO

  • Make csv.bz work
  • Clarify these two are exceptions (for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant