diff --git a/DESCRIPTION b/DESCRIPTION index 4a11c4b..cc7f60d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rio Type: Package Title: A Swiss-Army Knife for Data I/O -Version: 1.2.4 +Version: 1.2.5 Authors@R: c(person("Jason", "Becker", role = "aut", email = "jason@jbecker.co"), person("Chung-hong", "Chan", role = c("aut", "cre"), email = "chainsawtiney@gmail.com", comment = c(ORCID = "0000-0002-6232-7530")), @@ -52,7 +52,7 @@ Imports: tibble, writexl, lifecycle, - R.utils, + R.utils (>= 2.13.0), readr Suggests: datasets, @@ -70,7 +70,6 @@ Suggests: rmatio, xml2 (>= 1.2.0), yaml, - qs, arrow (>= 0.17.0), stringi, withr, diff --git a/NAMESPACE b/NAMESPACE index 0e3cf41..80dc39d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -19,7 +19,6 @@ S3method(.export,rio_ods) S3method(.export,rio_parquet) S3method(.export,rio_psv) S3method(.export,rio_pzfx) -S3method(.export,rio_qs) S3method(.export,rio_qs2) S3method(.export,rio_r) S3method(.export,rio_rda) @@ -58,7 +57,6 @@ S3method(.import,rio_ods) S3method(.import,rio_parquet) S3method(.import,rio_psv) S3method(.import,rio_pzfx) -S3method(.import,rio_qs) S3method(.import,rio_qs2) S3method(.import,rio_r) S3method(.import,rio_rda) diff --git a/NEWS.md b/NEWS.md index fa275eb..f70aa2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# rio 1.2.5 + +* Fix #473, remove support for `qs` + # rio 1.2.4 * Fix #463, export_list also allows ods and fods diff --git a/R/export.R b/R/export.R index 56e23ae..f7c37a0 100644 --- a/R/export.R +++ b/R/export.R @@ -25,10 +25,7 @@ #' \item R syntax object (.R), using [base::dput()] (by default) or [base::dump()] (if `format = 'dump'`) #' \item Saved R objects (.RData,.rda), using [base::save()]. In this case, `x` can be a data frame, a named list of objects, an R environment, or a character vector containing the names of objects if a corresponding `envir` argument is specified. #' \item Serialized R objects (.rds), using [base::saveRDS()]. In this case, `x` can be any serializable R object. -#' \item Serialized R objects (.qs), using [qs::qsave()], which is -#' significantly faster than .rds. This can be any R -#' object (not just a data frame). -#' \item Serialized R objects (.qs2), using [qs2::qs_save()]. This is the future-proof successor to using (.qs). +#' \item Serialized R objects (.qs2), using [qs2::qs_save()]. #' \item "XBASE" database files (.dbf), using [foreign::write.dbf()] #' \item Weka Attribute-Relation File Format (.arff), using [foreign::write.arff()] #' \item Fixed-width format data (.fwf), using [utils::write.table()] with `row.names = FALSE`, `quote = FALSE`, and `col.names = FALSE` diff --git a/R/export_methods.R b/R/export_methods.R index 38817c8..29a3769 100644 --- a/R/export_methods.R +++ b/R/export_methods.R @@ -285,12 +285,6 @@ export_delim <- function(file, x, fwrite = lifecycle::deprecated(), sep = "\t", .docall(nanoparquet::write_parquet, ..., args = list(x = x, file = file)) } -#' @export -.export.rio_qs <- function(file, x, ...) { - .check_pkg_availability("qs") - .docall(qs::qsave, ..., args = list(x = x, file = file)) -} - #' @export .export.rio_qs2 <- function(file, x, ...) { .check_pkg_availability("qs2") diff --git a/R/import.R b/R/import.R index 7e6f9d8..d3487c8 100644 --- a/R/import.R +++ b/R/import.R @@ -30,10 +30,7 @@ #' \item R syntax object (.R), using [base::dget()], see `trust` below. #' \item Saved R objects (.RData,.rda), using [base::load()] for single-object .Rdata files. Use `which` to specify an object name for multi-object .Rdata files. This can be any R object (not just a data frame), see `trust` below. #' \item Serialized R objects (.rds), using [base::readRDS()]. This can be any R object (not just a data frame), see `trust` below. -#' \item Serialized R objects (.qs), using [qs::qread()], which is -#' significantly faster than .rds. This can be any R -#' object (not just a data frame). -#' \item Serialized R objects (.qs2), using [qs2::qs_read()]. This is the future-proof successor to using (.qs). +#' \item Serialized R objects (.qs2), using [qs2::qs_read()]. #' \item Epiinfo (.rec), using [foreign::read.epiinfo()] #' \item Minitab (.mtp), using [foreign::read.mtp()] #' \item Systat (.syd), using [foreign::read.systat()] diff --git a/R/import_methods.R b/R/import_methods.R index 3c1fdf9..a11e992 100644 --- a/R/import_methods.R +++ b/R/import_methods.R @@ -420,12 +420,6 @@ extract_html_row <- function(x, empty_value) { .docall(nanoparquet::read_parquet, ..., args = list(file = file, options = nanoparquet::parquet_options(class = "data.frame"))) } -#' @export -.import.rio_qs <- function(file, which = 1, ...) { - .check_pkg_availability("qs") - .docall(qs::qread, ..., args = list(file = file)) -} - #' @export .import.rio_qs2 <- function(file, which = 1, ...) { .check_pkg_availability("qs2") diff --git a/R/sysdata.rda b/R/sysdata.rda index dab73d7..a6e4dbd 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/README.md b/README.md index e87a5af..0242a41 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ coverage](https://codecov.io/gh/gesistsa/rio/graph/badge.svg)](https://app.codec The aim of **rio** is to make data file I/O in R as easy as possible by implementing two main functions in Swiss-army knife style: -- `import()` provides a painless data import experience by automatically - choosing the appropriate import/read function based on file extension - (or a specified `format` argument) -- `export()` provides the same painless file recognition for data - export/write functionality + - `import()` provides a painless data import experience by + automatically choosing the appropriate import/read function based on + file extension (or a specified `format` argument) + - `export()` provides the same painless file recognition for data + export/write functionality ## Installation @@ -135,55 +135,54 @@ install_formats() The full list of supported formats is below: -| Name | Extensions / “format” | Import Package | Export Package | Type | Note | -|:---|:---|:---|:---|:---|:---| -| Archive files (handled by tar) | tar / tar.gz / tgz / tar.bz2 / tbz2 | utils | utils | Default | | -| Bzip2 | bz2 / bzip2 | base | base | Default | | -| Gzip | gz / gzip | base | base | Default | | -| Zip files | zip | utils | utils | Default | | -| Ambiguous file format | dat | data.table | | Default | Attempt as delimited text data | -| CSVY (CSV + YAML metadata header) | csvy | data.table | data.table | Default | | -| Comma-separated data | csv | data.table | data.table | Default | | -| Comma-separated data (European) | csv2 | data.table | data.table | Default | | -| Data Interchange Format | dif | utils | | Default | | -| Epiinfo | epiinfo / rec | foreign | | Default | | -| Excel | excel / xlsx | readxl | writexl | Default | | -| Excel (Legacy) | xls | readxl | | Default | | -| Excel (Read only) | xlsm / xltx / xltm | readxl | | Default | | -| Fixed-width format data | fwf | readr | utils | Default | | -| Fortran data | fortran | utils | | Default | No recognized extension | -| Google Sheets | googlesheets | data.table | | Default | As comma-separated data | -| Minitab | minitab / mtp | foreign | | Default | | -| Pipe-separated data | psv | data.table | data.table | Default | | -| R syntax | r | base | base | Default | | -| SAS | sas / sas7bdat | haven | haven | Default | Export is deprecated | -| SAS XPORT | xport / xpt | haven | haven | Default | | -| SPSS | sav / spss | haven | haven | Default | | -| SPSS (compressed) | zsav | haven | haven | Default | | -| SPSS Portable | por | haven | | Default | | -| Saved R objects | rda / rdata | base | base | Default | | -| Serialized R objects | rds | base | base | Default | | -| Stata | dta / stata | haven | haven | Default | | -| Systat | syd / systat | foreign | | Default | | -| Tab-separated data | / tsv / txt | data.table | data.table | Default | | -| Text Representations of R Objects | dump | base | base | Default | | -| Weka Attribute-Relation File Format | arff / weka | foreign | foreign | Default | | -| XBASE database files | dbf | foreign | foreign | Default | | -| Apache Arrow (Parquet) | parquet | nanoparquet | nanoparquet | Suggest | | -| Clipboard | clipboard | clipr | clipr | Suggest | default is tsv | -| EViews | eviews / wf1 | hexView | | Suggest | | -| Fast Storage | fst | fst | fst | Suggest | | -| Feather R/Python interchange format | feather | arrow | arrow | Suggest | | -| Graphpad Prism | pzfx | pzfx | pzfx | Suggest | | -| HTML Tables | htm / html | xml2 | xml2 | Suggest | | -| JSON | json | jsonlite | jsonlite | Suggest | | -| Matlab | mat / matlab | rmatio | rmatio | Suggest | | -| OpenDocument Spreadsheet | ods | readODS | readODS | Suggest | | -| OpenDocument Spreadsheet (Flat) | fods | readODS | readODS | Suggest | | -| Serialized R objects (qs) | qs | qs | qs | Suggest | | -| Serialized R objects (qs2) | qs2 | qs2 | qs2 | Suggest | Replaces {qs} package which will be deprecated. | -| Shallow XML documents | xml | xml2 | xml2 | Suggest | | -| YAML | yaml / yml | yaml | yaml | Suggest | | +| Name | Extensions / “format” | Import Package | Export Package | Type | Note | +| :---------------------------------- | :---------------------------------- | :------------- | :------------- | :------ | :----------------------------- | +| Archive files (handled by tar) | tar / tar.gz / tgz / tar.bz2 / tbz2 | utils | utils | Default | | +| Bzip2 | bz2 / bzip2 | base | base | Default | | +| Gzip | gz / gzip | base | base | Default | | +| Zip files | zip | utils | utils | Default | | +| Ambiguous file format | dat | data.table | | Default | Attempt as delimited text data | +| CSVY (CSV + YAML metadata header) | csvy | data.table | data.table | Default | | +| Comma-separated data | csv | data.table | data.table | Default | | +| Comma-separated data (European) | csv2 | data.table | data.table | Default | | +| Data Interchange Format | dif | utils | | Default | | +| Epiinfo | epiinfo / rec | foreign | | Default | | +| Excel | excel / xlsx | readxl | writexl | Default | | +| Excel (Legacy) | xls | readxl | | Default | | +| Excel (Read only) | xlsm / xltx / xltm | readxl | | Default | | +| Fixed-width format data | fwf | readr | utils | Default | | +| Fortran data | fortran | utils | | Default | No recognized extension | +| Google Sheets | googlesheets | data.table | | Default | As comma-separated data | +| Minitab | minitab / mtp | foreign | | Default | | +| Pipe-separated data | psv | data.table | data.table | Default | | +| R syntax | r | base | base | Default | | +| SAS | sas / sas7bdat | haven | haven | Default | Export is deprecated | +| SAS XPORT | xport / xpt | haven | haven | Default | | +| SPSS | sav / spss | haven | haven | Default | | +| SPSS (compressed) | zsav | haven | haven | Default | | +| SPSS Portable | por | haven | | Default | | +| Saved R objects | rda / rdata | base | base | Default | | +| Serialized R objects | rds | base | base | Default | | +| Stata | dta / stata | haven | haven | Default | | +| Systat | syd / systat | foreign | | Default | | +| Tab-separated data | / tsv / txt | data.table | data.table | Default | | +| Text Representations of R Objects | dump | base | base | Default | | +| Weka Attribute-Relation File Format | arff / weka | foreign | foreign | Default | | +| XBASE database files | dbf | foreign | foreign | Default | | +| Apache Arrow (Parquet) | parquet | nanoparquet | nanoparquet | Suggest | | +| Clipboard | clipboard | clipr | clipr | Suggest | default is tsv | +| EViews | eviews / wf1 | hexView | | Suggest | | +| Fast Storage | fst | fst | fst | Suggest | | +| Feather R/Python interchange format | feather | arrow | arrow | Suggest | | +| Graphpad Prism | pzfx | pzfx | pzfx | Suggest | | +| HTML Tables | htm / html | xml2 | xml2 | Suggest | | +| JSON | json | jsonlite | jsonlite | Suggest | | +| Matlab | mat / matlab | rmatio | rmatio | Suggest | | +| OpenDocument Spreadsheet | ods | readODS | readODS | Suggest | | +| OpenDocument Spreadsheet (Flat) | fods | readODS | readODS | Suggest | | +| Serialized R objects (qs2) | qs2 | qs2 | qs2 | Suggest | | +| Shallow XML documents | xml | xml2 | xml2 | Suggest | | +| YAML | yaml / yml | yaml | yaml | Suggest | | Additionally, any format that is not supported by **rio** but that has a known R implementation will produce an informative error message @@ -254,22 +253,23 @@ c("mtcars.tsv", "iris.tsv") %in% dir() ### GUIs -- [**datamods**](https://cran.r-project.org/package=datamods) provides - Shiny modules for importing data via `rio`. -- [**rioweb**](https://github.com/lbraglia/rioweb) that provides access - to the file conversion features of `rio`. -- [**GREA**](https://github.com/Stan125/GREA/) is an RStudio add-in that - provides an interactive interface for reading in data using `rio`. + - [**datamods**](https://cran.r-project.org/package=datamods) provides + Shiny modules for importing data via `rio`. + - [**rioweb**](https://github.com/lbraglia/rioweb) that provides + access to the file conversion features of `rio`. + - [**GREA**](https://github.com/Stan125/GREA/) is an RStudio add-in + that provides an interactive interface for reading in data using + `rio`. ### Similar packages -- [**reader**](https://cran.r-project.org/package=reader) handles - certain text formats and R binary files -- [**io**](https://cran.r-project.org/package=io) offers a set of custom - formats -- [**ImportExport**](https://cran.r-project.org/package=ImportExport) - focuses on select binary formats (Excel, SPSS, and Access files) and - provides a Shiny interface. -- [**SchemaOnRead**](https://cran.r-project.org/package=SchemaOnRead) - iterates through a large number of possible import methods until one - works successfully + - [**reader**](https://cran.r-project.org/package=reader) handles + certain text formats and R binary files + - [**io**](https://cran.r-project.org/package=io) offers a set of + custom formats + - [**ImportExport**](https://cran.r-project.org/package=ImportExport) + focuses on select binary formats (Excel, SPSS, and Access files) and + provides a Shiny interface. + - [**SchemaOnRead**](https://cran.r-project.org/package=SchemaOnRead) + iterates through a large number of possible import methods until one + works successfully diff --git a/data-raw/single.json b/data-raw/single.json index 0d475a7..7f575bf 100644 --- a/data-raw/single.json +++ b/data-raw/single.json @@ -623,7 +623,7 @@ { "input": "qs", "format": "qs", - "type": "suggest", + "type": "known", "format_name": "Serialized R objects (qs)", "import_function": "qs::qread", "export_function": "qs::qsave", @@ -636,7 +636,7 @@ "format_name": "Serialized R objects (qs2)", "import_function": "qs2::qs_save", "export_function": "qs2::qs_read", - "note": "Replaces {qs} package which will be deprecated." + "note": "" }, { "input": "xml", diff --git a/man/export.Rd b/man/export.Rd index 2e09d29..7fb563c 100644 --- a/man/export.Rd +++ b/man/export.Rd @@ -41,10 +41,7 @@ The output file can be to a compressed directory, simply by adding an appropriat \item R syntax object (.R), using \code{\link[base:dput]{base::dput()}} (by default) or \code{\link[base:dump]{base::dump()}} (if \code{format = 'dump'}) \item Saved R objects (.RData,.rda), using \code{\link[base:save]{base::save()}}. In this case, \code{x} can be a data frame, a named list of objects, an R environment, or a character vector containing the names of objects if a corresponding \code{envir} argument is specified. \item Serialized R objects (.rds), using \code{\link[base:readRDS]{base::saveRDS()}}. In this case, \code{x} can be any serializable R object. -\item Serialized R objects (.qs), using \code{\link[qs:qsave]{qs::qsave()}}, which is -significantly faster than .rds. This can be any R -object (not just a data frame). -\item Serialized R objects (.qs2), using \code{\link[qs2:qs_save]{qs2::qs_save()}}. This is the future-proof successor to using (.qs). +\item Serialized R objects (.qs2), using \code{\link[qs2:qs_save]{qs2::qs_save()}}. \item "XBASE" database files (.dbf), using \code{\link[foreign:write.dbf]{foreign::write.dbf()}} \item Weka Attribute-Relation File Format (.arff), using \code{\link[foreign:write.arff]{foreign::write.arff()}} \item Fixed-width format data (.fwf), using \code{\link[utils:write.table]{utils::write.table()}} with \code{row.names = FALSE}, \code{quote = FALSE}, and \code{col.names = FALSE} diff --git a/man/import.Rd b/man/import.Rd index 6d710b4..3d7d38a 100644 --- a/man/import.Rd +++ b/man/import.Rd @@ -53,10 +53,7 @@ This function imports a data frame or matrix from a data file with the file form \item R syntax object (.R), using \code{\link[base:dput]{base::dget()}}, see \code{trust} below. \item Saved R objects (.RData,.rda), using \code{\link[base:load]{base::load()}} for single-object .Rdata files. Use \code{which} to specify an object name for multi-object .Rdata files. This can be any R object (not just a data frame), see \code{trust} below. \item Serialized R objects (.rds), using \code{\link[base:readRDS]{base::readRDS()}}. This can be any R object (not just a data frame), see \code{trust} below. -\item Serialized R objects (.qs), using \code{\link[qs:qread]{qs::qread()}}, which is -significantly faster than .rds. This can be any R -object (not just a data frame). -\item Serialized R objects (.qs2), using \code{\link[qs2:qs_read]{qs2::qs_read()}}. This is the future-proof successor to using (.qs). +\item Serialized R objects (.qs2), using \code{\link[qs2:qs_read]{qs2::qs_read()}}. \item Epiinfo (.rec), using \code{\link[foreign:read.epiinfo]{foreign::read.epiinfo()}} \item Minitab (.mtp), using \code{\link[foreign:read.mtp]{foreign::read.mtp()}} \item Systat (.syd), using \code{\link[foreign:read.systat]{foreign::read.systat()}} diff --git a/tests/testthat/test_format_qs.R b/tests/testthat/test_format_qs.R deleted file mode 100644 index 89c9718..0000000 --- a/tests/testthat/test_format_qs.R +++ /dev/null @@ -1,9 +0,0 @@ -skip_if_not_installed("qs") - -test_that("Export to and import from qs", { - withr::with_tempfile("iris_file", fileext = ".qs", code = { - export(iris, iris_file) - expect_true(file.exists(iris_file)) - expect_true(is.data.frame(import(iris_file))) - }) -}) diff --git a/tests/testthat/test_import_list.R b/tests/testthat/test_import_list.R index aa088e3..0d7ad84 100644 --- a/tests/testthat/test_import_list.R +++ b/tests/testthat/test_import_list.R @@ -193,12 +193,11 @@ test_that("Universal dummy `which` #326", { }) test_that("Universal dummy `which` (Suggests) #326", { - skip_if_not_installed("qs") skip_if_not_installed("qs2") skip_if_not_installed("arrow") skip_if_not_installed("readODS") skip_on_os("mac") ## apache/arrow#40991 - formats <- c("qs", "qs2", "parquet", "ods") + formats <- c("qs2", "parquet", "ods") for (format in formats) { withr::with_tempfile("tempzip", fileext = paste0(".", format, ".zip"), code = { rio::export(mtcars, tempzip, format = format)