diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png index 110d404..348a54a 100644 Binary files a/apple-touch-icon-120x120.png and b/apple-touch-icon-120x120.png differ diff --git a/apple-touch-icon-152x152.png b/apple-touch-icon-152x152.png index de207f8..889eeb2 100644 Binary files a/apple-touch-icon-152x152.png and b/apple-touch-icon-152x152.png differ diff --git a/apple-touch-icon-180x180.png b/apple-touch-icon-180x180.png index 30358ef..ef6c377 100644 Binary files a/apple-touch-icon-180x180.png and b/apple-touch-icon-180x180.png differ diff --git a/apple-touch-icon-60x60.png b/apple-touch-icon-60x60.png index 97d4a72..7ed22a3 100644 Binary files a/apple-touch-icon-60x60.png and b/apple-touch-icon-60x60.png differ diff --git a/apple-touch-icon-76x76.png b/apple-touch-icon-76x76.png index b7758b1..26c7327 100644 Binary files a/apple-touch-icon-76x76.png and b/apple-touch-icon-76x76.png differ diff --git a/apple-touch-icon.png b/apple-touch-icon.png index d57e4d9..bb00024 100644 Binary files a/apple-touch-icon.png and b/apple-touch-icon.png differ diff --git a/articles/rio.html b/articles/rio.html index 66c037b..c54bdae 100644 --- a/articles/rio.html +++ b/articles/rio.html @@ -88,7 +88,7 @@

The full list of supported formats is below:

- +
------++++++ @@ -158,21 +158,29 @@

Supported file formats

- + - - - - + + + + - + + + + + + + + + @@ -180,7 +188,7 @@

Supported file formatsDefault

- + @@ -188,7 +196,7 @@

Supported file formatsDefault

- + @@ -196,7 +204,7 @@

Supported file formatsDefault

- + @@ -204,7 +212,7 @@

Supported file formatsDefault

- + @@ -212,7 +220,7 @@

Supported file formatsDefault

- + @@ -220,7 +228,7 @@

Supported file formatsDefault

- + @@ -228,7 +236,7 @@

Supported file formatsDefault

- + @@ -236,7 +244,7 @@

Supported file formatsDefault

- + @@ -244,7 +252,7 @@

Supported file formatsDefault

- + @@ -252,7 +260,7 @@

Supported file formatsDefault

- + @@ -260,7 +268,7 @@

Supported file formatsDefault

- + @@ -268,7 +276,7 @@

Supported file formatsDefault

- + @@ -276,7 +284,7 @@

Supported file formatsDefault

- + @@ -284,7 +292,7 @@

Supported file formatsDefault

- + @@ -292,7 +300,7 @@

Supported file formatsDefault

- + @@ -300,7 +308,7 @@

Supported file formatsDefault

- + @@ -308,7 +316,7 @@

Supported file formatsDefault

- + @@ -316,7 +324,7 @@

Supported file formatsDefault

- + @@ -324,7 +332,7 @@

Supported file formatsDefault

- + @@ -332,7 +340,7 @@

Supported file formatsDefault

- + @@ -340,7 +348,7 @@

Supported file formatsDefault

- + @@ -348,7 +356,7 @@

Supported file formatsDefault

- + @@ -356,7 +364,7 @@

Supported file formatsDefault

- + @@ -364,7 +372,7 @@

Supported file formatsDefault

- + @@ -372,7 +380,7 @@

Supported file formatsDefault

- + @@ -380,7 +388,7 @@

Supported file formatsDefault

- + @@ -388,7 +396,7 @@

Supported file formatsDefault

- + @@ -396,7 +404,7 @@

Supported file formatsSuggest

- + @@ -404,7 +412,7 @@

Supported file formatsSuggest

- + @@ -412,7 +420,7 @@

Supported file formatsSuggest

- + @@ -420,7 +428,7 @@

Supported file formatsSuggest

- + @@ -428,7 +436,7 @@

Supported file formatsSuggest

- + @@ -436,7 +444,7 @@

Supported file formatsSuggest

- + @@ -444,7 +452,7 @@

Supported file formatsSuggest

- + @@ -452,7 +460,7 @@

Supported file formatsSuggest

- + @@ -460,7 +468,7 @@

Supported file formatsSuggest

- + @@ -468,7 +476,7 @@

Supported file formatsSuggest

- + @@ -476,7 +484,7 @@

Supported file formatsSuggest

- + @@ -484,7 +492,7 @@

Supported file formatsSuggest

- + @@ -492,7 +500,7 @@

Supported file formatsSuggest

- + diff --git a/favicon-16x16.png b/favicon-16x16.png index a49bb29..8444f2c 100644 Binary files a/favicon-16x16.png and b/favicon-16x16.png differ diff --git a/favicon-32x32.png b/favicon-32x32.png index 67663fc..eb255b2 100644 Binary files a/favicon-32x32.png and b/favicon-32x32.png differ diff --git a/index.html b/index.html index 8375082..00789ca 100644 --- a/index.html +++ b/index.html @@ -178,12 +178,12 @@

Supported file formatsThe full list of supported formats is below:

Name
Archive files (handled by tar)tar / tar.gztar / tar.gz / tgz / tar.bz2 / tbz2 utils utils Default
Compressed CSVgzdata.tabledata.tableBzip2bz2 / bzip2basebase DefaultOnly csv.gz is supported
Gzipgz / gzipbasebaseDefault
Zip files zip utils
CSVY (CSV + YAML metadata header) csvy data.table
Comma-separated data csv data.table
Comma-separated data (European) csv2 data.table
Data Interchange Format dif utils
Epiinfo epiinfo / rec foreign
Excel excel / xlsx readxl
Excel (Legacy) xls readxl
Fixed-width format data fwf readr
Fortran data fortran utilsNo recognized extension
Google Sheets googlesheets data.tableAs comma-separated data
Minitab minitab / mtp foreign
Pipe-separated data psv data.table
R syntax r base
SAS sas / sas7bdat havenExport is deprecated
SAS XPORT xport / xpt haven
SPSS sav / spss haven
SPSS (compressed) zsav haven
SPSS Portable por haven
Saved R objects rda / rdata base
Serialized R objects rds base
Stata dta / stata haven
Systat syd / systat foreign
Tab-separated data / tsv / txt data.table
Text Representations of R Objects dump base
Weka Attribute-Relation File Format arff / weka foreign
XBASE database files dbf foreign
Apache Arrow (Parquet) parquet arrow
Clipboard clipboard cliprdefault is tsv
EViews eviews / wf1 hexView
Fast Storage fst fst
Feather R/Python interchange format feather arrow
Graphpad Prism pzfx pzfx
HTML Tables htm / html xml2
JSON json jsonlite
Matlab mat / matlab rmatio
OpenDocument Spreadsheet ods readODS
OpenDocument Spreadsheet (Flat) fods readODS
Serialized R objects (Quick) qs qs
Shallow XML documents xml xml2
YAML yaml / yml yaml
------++++++ @@ -196,21 +196,29 @@

Supported file formats

- + - - - - + + + + - + + + + + + + + + @@ -218,7 +226,7 @@

Supported file formatsDefault

- + @@ -226,7 +234,7 @@

Supported file formatsDefault

- + @@ -234,7 +242,7 @@

Supported file formatsDefault

- + @@ -242,7 +250,7 @@

Supported file formatsDefault

- + @@ -250,7 +258,7 @@

Supported file formatsDefault

- + @@ -258,7 +266,7 @@

Supported file formatsDefault

- + @@ -266,7 +274,7 @@

Supported file formatsDefault

- + @@ -274,7 +282,7 @@

Supported file formatsDefault

- + @@ -282,7 +290,7 @@

Supported file formatsDefault

- + @@ -290,7 +298,7 @@

Supported file formatsDefault

- + @@ -298,7 +306,7 @@

Supported file formatsDefault

- + @@ -306,7 +314,7 @@

Supported file formatsDefault

- + @@ -314,7 +322,7 @@

Supported file formatsDefault

- + @@ -322,7 +330,7 @@

Supported file formatsDefault

- + @@ -330,7 +338,7 @@

Supported file formatsDefault

- + @@ -338,7 +346,7 @@

Supported file formatsDefault

- + @@ -346,7 +354,7 @@

Supported file formatsDefault

- + @@ -354,7 +362,7 @@

Supported file formatsDefault

- + @@ -362,7 +370,7 @@

Supported file formatsDefault

- + @@ -370,7 +378,7 @@

Supported file formatsDefault

- + @@ -378,7 +386,7 @@

Supported file formatsDefault

- + @@ -386,7 +394,7 @@

Supported file formatsDefault

- + @@ -394,7 +402,7 @@

Supported file formatsDefault

- + @@ -402,7 +410,7 @@

Supported file formatsDefault

- + @@ -410,7 +418,7 @@

Supported file formatsDefault

- + @@ -418,7 +426,7 @@

Supported file formatsDefault

- + @@ -426,7 +434,7 @@

Supported file formatsDefault

- + @@ -434,7 +442,7 @@

Supported file formatsSuggest

- + @@ -442,7 +450,7 @@

Supported file formatsSuggest

- + @@ -450,7 +458,7 @@

Supported file formatsSuggest

- + @@ -458,7 +466,7 @@

Supported file formatsSuggest

- + @@ -466,7 +474,7 @@

Supported file formatsSuggest

- + @@ -474,7 +482,7 @@

Supported file formatsSuggest

- + @@ -482,7 +490,7 @@

Supported file formatsSuggest

- + @@ -490,7 +498,7 @@

Supported file formatsSuggest

- + @@ -498,7 +506,7 @@

Supported file formatsSuggest

- + @@ -506,7 +514,7 @@

Supported file formatsSuggest

- + @@ -514,7 +522,7 @@

Supported file formatsSuggest

- + @@ -522,7 +530,7 @@

Supported file formatsSuggest

- + @@ -530,7 +538,7 @@

Supported file formatsSuggest

- + diff --git a/news/index.html b/news/index.html index b207243..67eddc4 100644 --- a/news/index.html +++ b/news/index.html @@ -58,7 +58,8 @@

rio 1.0.3

-

rio 1.0.2

diff --git a/pkgdown.yml b/pkgdown.yml index 745bdd9..ea8e867 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -7,7 +7,7 @@ articles: philosophy: philosophy.html remap: remap.html rio: rio.html -last_built: 2024-05-13T17:46Z +last_built: 2024-05-14T22:46Z urls: reference: http://gesistsa.github.io/rio/reference article: http://gesistsa.github.io/rio/articles diff --git a/reference/export.html b/reference/export.html index b2fa8da..8e2e267 100644 --- a/reference/export.html +++ b/reference/export.html @@ -96,7 +96,6 @@

DetailsThe output file can be to a compressed directory, simply by adding an appropriate additional extensiont to the file argument, such as: “mtcars.csv.tar”, “mtcars.csv.zip”, or “mtcars.csv.gz”.

export supports many file formats. See the documentation for the underlying export functions for optional arguments that can be passed via ...

  • Comma-separated data (.csv), using data.table::fwrite()

  • -
  • gzip comma-separated data (.csv.gz), using data.table::fwrite()

  • Pipe-separated data (.psv), using data.table::fwrite()

  • Tab-separated data (.tsv), using data.table::fwrite()

  • SAS (.sas7bdat), using haven::write_sas().

  • diff --git a/reference/import.html b/reference/import.html index 221d5db..95d0b60 100644 --- a/reference/import.html +++ b/reference/import.html @@ -75,7 +75,7 @@

    Usage

    Arguments

    file
    -

    A character string naming a file, URL, or single-file .zip or .tar archive.

    +

    A character string naming a file, URL, or single-file (can be Gzip or Bzip2 compressed), .zip or .tar archive.

    format
    @@ -110,7 +110,6 @@

    DetailsThis function imports a data frame or matrix from a data file with the file format based on the file extension (or the manually specified format, if format is specified).

    import supports the following file formats:

    • Comma-separated data (.csv), using data.table::fread()

    • -
    • gzip comma-separated data (.csv.gz), using data.table::fread()

    • Pipe-separated data (.psv), using data.table::fread()

    • Tab-separated data (.tsv), using data.table::fread()

    • SAS (.sas7bdat), using haven::read_sas()

    • diff --git a/search.json b/search.json index 2a656a1..c60c3d1 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"http://gesistsa.github.io/rio/articles/extension.html","id":"arff","dir":"Articles","previous_headings":"Examples","what":"arff","title":"Extending rio","text":"following example shows arff import export methods implemented internally.","code":".import.rio_arff <- function(file, which = 1, ...) { foreign::read.arff(file = file) } .export.rio_arff <- function(file, x, ...) { foreign::write.arff(x = x, file = file, ...) }"},{"path":"http://gesistsa.github.io/rio/articles/extension.html","id":"ledger","dir":"Articles","previous_headings":"Examples","what":"ledger","title":"Extending rio","text":"example ledger package (MIT) Dr Trevor L David .","code":".import.rio_ledger <- register # nolint register <- function(file, ..., toolchain = default_toolchain(file), date = NULL) { .assert_toolchain(toolchain) switch(toolchain, \"ledger\" = register_ledger(file, ..., date = date), \"hledger\" = register_hledger(file, ..., date = date), \"beancount\" = register_beancount(file, ..., date = date), \"bean-report_ledger\" = { file <- .bean_report(file, \"ledger\") on.exit(unlink(file)) register_ledger(file, ..., date = date) }, \"bean-report_hledger\" = { file <- .bean_report(file, \"hledger\") on.exit(unlink(file)) register_hledger(file, ..., date = date) } ) }"},{"path":"http://gesistsa.github.io/rio/articles/remap.html","id":"remapping","dir":"Articles","previous_headings":"","what":"Remapping","title":"Remapping and Ellipsis","text":"two conventions arguments among underlying functions used rio. Let’s call Base Convention “Tidy” Convention. rio can map Base Convention “Tidy” Convention (vice versa). can still use “Tidy” Convention, underlying function supports .","code":"library(rio) export(list(\"mtcars\" = mtcars, \"iris\" = iris), \"example.xlsx\") import(\"example.xlsx\", which = \"mtcars\") #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 import(\"example.xlsx\", sheet = \"mtcars\") #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"http://gesistsa.github.io/rio/articles/remap.html","id":"ellipsis-or-dot-dot-dot","dir":"Articles","previous_headings":"","what":"Ellipsis or “dot dot dot”","title":"Remapping and Ellipsis","text":"Additional parameters usually passed underlying function ellipsis (...). Parameters underlying function recognize silently ignored default. don’t like behavior, please change option rio.ignoreunusedargs FALSE, .e. options(rio.ignoreunusedargs = FALSE).","code":"## n_max is an argument of readxl::read_xlsx import(\"example.xlsx\", sheet = \"iris\", n_max = 10) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 import(\"example.xlsx\", sheet = \"iris\", n_max = 10, pizza = \"pineapple\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 options(rio.ignoreunusedargs = FALSE) import(\"example.xlsx\", sheet = \"iris\", n_max = 10, pizza = \"pineapple\") #> Error in (function (path, sheet = NULL, range = NULL, col_names = TRUE, : unused argument (pizza = \"pineapple\")"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"import-export-and-convert-data-files","dir":"Articles","previous_headings":"","what":"Import, Export, and Convert Data Files","title":"Import, Export, and Convert Data Files","text":"idea behind rio simplify process importing data R exporting data R. process , probably unnecessarily, extremely complex beginning R users. Indeed, R supplies entire manual describing process data import/export. , despite text, packages described (varying degrees) --date. Faster, simpler, packages fewer dependencies created many file types described document. rio aims unify data /O (importing exporting) two simple functions: import() export() beginners (experienced R users) never think twice (even ) best way read write R data. core advantage rio makes assumptions user probably willing make. Specifically, rio uses file extension file name determine kind file . logic used Windows OS, example, determining application associated given file type. taking away need manually match file type (beginner may recognize) particular import export function, rio allows almost common data formats read function. making import export easy, ’s obvious next step also use R simple data conversion utility. Transferring data files various proprietary formats always pain often expensive. convert function therefore combines import export easily convert file formats (thus providing FOSS replacement programs like Stat/Transfer Sledgehammer).","code":""},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"supported-file-formats","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Supported file formats","title":"Import, Export, and Convert Data Files","text":"rio supports variety different file formats import export. keep package slim, non-essential formats supported via “Suggests” packages, installed (loaded) default. ensure rio fully functional, install packages first time use rio via: full list supported formats : Additionally, format supported rio known R implementation produce informative error message pointing package import export function. Unrecognized formats yield simple “Unrecognized file format” error.","code":"install_formats()"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"data-import","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Data Import","title":"Import, Export, and Convert Data Files","text":"rio allows import files almost format using one, typically single-argument, function. import() infers file format file’s extension calls appropriate data import function , returning simple data.frame. works formats listed . reason file extension, file extension match actual type, can manually specify file format override format inference step. example, can read CSV file file extension specifying csv:","code":"library(\"rio\") x <- import(\"mtcars.csv\") y <- import(\"mtcars.dta\") # confirm identical all.equal(x, y, check.attributes = FALSE) ## [1] TRUE head(import(\"mtcars_noext\", format = \"csv\")) ## mpg cyl disp hp drat wt qsec vs am gear carb ## 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 ## 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 ## 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 ## 4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 ## 5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 ## 6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"importing-data-lists","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files > Data Import","what":"Importing Data Lists","title":"Import, Export, and Convert Data Files","text":"Sometimes may multiple data files want import. import() ever returns single data frame, import_list() can used import vector file names R. works even files different formats: Similarly, single-file formats (e.g. Excel Workbooks, Zip directories, HTML files, etc.) can contain multiple data sets. import() type safe, always returning data frame, importing formats requires specifying argument import() dictate data set (worksheet, file, table, etc.) import (default = 1). import_list() can used import (specified subset, via ) data objects types files.","code":"str(import_list(dir()), 1)"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"data-export","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Data Export","title":"Import, Export, and Convert Data Files","text":"export capabilities rio somewhat limited import capabilities, given availability different functions various R packages import functions often written make use data applications never seems development priority functions export formats used applications. said, rio currently supports following formats: also easy use export() part R pipeline (magrittr dplyr). example, following code uses export() save results simple data transformation: file formats (e.g., Excel workbooks, Rdata files) can support multiple data objects single file. export() natively supports output multiple objects types files: also possible use new (v0.6.0) function export_list() write list data frames multiple files using either vector file names file pattern:","code":"library(\"rio\") export(mtcars, \"mtcars.csv\") export(mtcars, \"mtcars.dta\") library(\"magrittr\") mtcars %>% subset(hp > 100) %>% aggregate(. ~ cyl + am, data = ., FUN = mean) %>% export(file = \"mtcars2.dta\") # export to sheets of an Excel workbook export(list(mtcars = mtcars, iris = iris), \"multi.xlsx\") export_list(list(mtcars = mtcars, iris = iris), \"%s.tsv\")"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"file-conversion","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"File Conversion","title":"Import, Export, and Convert Data Files","text":"convert() function links import() export() constructing dataframe imported file immediately writing back disk. convert() invisibly returns file name exported file, can used programmatically access new file. convert() just thin wrapper import() export(), easy use. example, can convert convert() also accepts lists arguments controlling import (in_opts) export (out_opts). can useful passing additional arguments import export methods. useful, example, reading fixed-width format file converting comma-separated values file: metadata-rich file formats (e.g., Stata, SPSS, SAS), can also useful pass imported data characterize() factorize() converting open, text-delimited format: characterize() converts single variable variables data frame “labels” attributes character vectors based mapping values value labels (e.g., export(characterize(import(\"file.dta\")), \"file.csv\")). alternative approach exporting CSVY format, records metadata YAML-formatted header beginning CSV file. also possible use rio command-line calling Rscript -e (expression) argument. example, convert file Stata (.dta) comma-separated values (.csv), simply following:","code":"# create file to convert export(mtcars, \"mtcars.dta\") # convert Stata to SPSS convert(\"mtcars.dta\", \"mtcars.sav\") # create an ambiguous file fwf <- tempfile(fileext = \".fwf\") cat(file = fwf, \"123456\", \"987654\", sep = \"\\n\") # see two ways to read in the file identical(import(fwf, widths = c(1, 2, 3)), import(fwf, widths = c(1, -2, 3))) ## Warning: The `widths` argument of `import()` is deprecated as of rio 1.0.2. ## ℹ `widths` is kept for backward compatibility. Please use `col_positions` or ## unset `widths` to allow automatic guessing, see `?readr::read_fwf`. The ## parameter `widths` will be dropped in v2.0.0. ## ℹ The deprecated feature was likely used in the rio package. ## Please report the issue at . ## This warning is displayed once every 8 hours. ## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was ## generated. ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ## [1] FALSE # convert to CSV convert(fwf, \"fwf.csv\", in_opts = list(widths = c(1, 2, 3))) ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. import(\"fwf.csv\") # check conversion ## X1 X2 X3 ## 1 1 23 456 ## 2 9 87 654 Rscript -e \"rio::convert('mtcars.dta', 'mtcars.csv')\""},{"path":"http://gesistsa.github.io/rio/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jason Becker. Author. Chung-hong Chan. Author, maintainer. David Schoch. Author. Geoffrey CH Chan. Contributor. Thomas J. Leeper. Author. Christopher Gandrud. Contributor. Andrew MacDonald. Contributor. Ista Zahn. Contributor. Stanislaus Stadlmann. Contributor. Ruaridh Williamson. Contributor. Patrick Kennedy. Contributor. Ryan Price. Contributor. Trevor L Davis. Contributor. Nathan Day. Contributor. Bill Denney. Contributor. Alex Bokov. Contributor.","code":""},{"path":"http://gesistsa.github.io/rio/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Chan C, Leeper T, Becker J, Schoch D (2023). rio: Swiss-army knife data file /O. https://cran.r-project.org/package=rio.","code":"@Manual{, title = {rio: A Swiss-army knife for data file I/O}, author = {Chung-hong Chan and Thomas J. Leeper and Jason Becker and David Schoch}, url = {https://cran.r-project.org/package=rio}, year = {2023}, }"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"A Swiss-Army Knife for Data I/O","text":"aim rio make data file /O R easy possible implementing two main functions Swiss-army knife style: import() provides painless data import experience automatically choosing appropriate import/read function based file extension (specified format argument) export() provides painless file recognition data export/write functionality","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Swiss-Army Knife for Data I/O","text":"package available CRAN can installed directly R using install.packages(). latest development version GitHub can installed using: Optional: Installation additional formats (see : Supported file formats)","code":"install.packages(\"rio\") if (!require(\"remotes\")){ install.packages(\"remotes\") } remotes::install_github(\"gesistsa/rio\") library(rio) install_formats()"},{"path":"http://gesistsa.github.io/rio/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"A Swiss-Army Knife for Data I/O","text":"rio meant streamline data /O, package extremely easy use. examples reading, writing, converting data files.","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"import","dir":"","previous_headings":"Usage","what":"Import","title":"A Swiss-Army Knife for Data I/O","text":"Importing data handled one function, import(): Note: inconsistencies across underlying packages, data.frame returned import might vary slightly (variable classes attributes) depending file type.","code":"library(\"rio\") import(\"starwars.xlsx\") ## Name homeworld species ## 1 Luke Skywalker Tatooine Human ## 2 C-3PO Tatooine Human ## 3 R2-D2 Alderaan Human ## 4 Darth Vader Tatooine Human ## 5 Leia Organa Tatooine Human ## 6 Owen Lars Tatooine Human ## 7 Beru Whitesun lars Stewjon Human ## 8 R5-D4 Tatooine Human ## 9 Biggs Darklighter Kashyyyk Wookiee ## 10 Obi-Wan Kenobi Corellia Human import(\"starwars.csv\") ## Name homeworld species ## 1 Luke Skywalker Tatooine Human ## 2 C-3PO Tatooine Human ## 3 R2-D2 Alderaan Human ## 4 Darth Vader Tatooine Human ## 5 Leia Organa Tatooine Human ## 6 Owen Lars Tatooine Human ## 7 Beru Whitesun lars Stewjon Human ## 8 R5-D4 Tatooine Human ## 9 Biggs Darklighter Kashyyyk Wookiee ## 10 Obi-Wan Kenobi Corellia Human"},{"path":"http://gesistsa.github.io/rio/index.html","id":"export","dir":"","previous_headings":"Usage","what":"Export","title":"A Swiss-Army Knife for Data I/O","text":"Exporting data handled one function, export(): particularly useful feature rio ability import export compressed (e.g., zip) directories, saving users extra step compressing large exported file, e.g.: export() can also write multiple data frames respective sheets Excel workbook HTML file:","code":"export(mtcars, \"mtcars.csv\") # comma-separated values export(mtcars, \"mtcars.rds\") # R serialized export(mtcars, \"mtcars.sav\") # SPSS export(mtcars, \"mtcars.tsv.zip\") export(list(mtcars = mtcars, iris = iris), file = \"mtcars.xlsx\")"},{"path":"http://gesistsa.github.io/rio/index.html","id":"supported-file-formats","dir":"","previous_headings":"","what":"Supported file formats","title":"A Swiss-Army Knife for Data I/O","text":"rio supports wide range file formats. keep package slim, several formats supported via “Suggests” packages, installed (loaded) default. ensure rio fully functional, install packages first time use rio via: full list supported formats : Additionally, format supported rio known R implementation produce informative error message pointing package import export function. Unrecognized formats yield simple “Unrecognized file format” error.","code":"install_formats()"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"convert","dir":"","previous_headings":"Other functions","what":"Convert","title":"A Swiss-Army Knife for Data I/O","text":"convert() function links import() export() constructing dataframe imported file immediately writing back disk. convert() invisibly returns file name exported file, can used programmatically access new file. also possible use rio command-line calling Rscript -e (expression) argument. example, convert file Stata (.dta) comma-separated values (.csv), simply following:","code":"convert(\"mtcars.sav\", \"mtcars.dta\") Rscript -e \"rio::convert('iris.dta', 'iris.csv')\""},{"path":"http://gesistsa.github.io/rio/index.html","id":"id__list","dir":"","previous_headings":"Other functions","what":"*_list","title":"A Swiss-Army Knife for Data I/O","text":"import_list() allows users import list data frames multi-object file (Excel workbook, .Rdata file, zip directory, HTML file): export_list() makes easy export list (possibly named) data frames multiple files:","code":"str(m <- import_list(\"mtcars.xlsx\")) ## List of 2 ## $ mtcars:'data.frame': 32 obs. of 11 variables: ## ..$ mpg : num [1:32] 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... ## ..$ cyl : num [1:32] 6 6 4 6 8 6 8 4 4 6 ... ## ..$ disp: num [1:32] 160 160 108 258 360 ... ## ..$ hp : num [1:32] 110 110 93 110 175 105 245 62 95 123 ... ## ..$ drat: num [1:32] 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ... ## ..$ wt : num [1:32] 2.62 2.88 2.32 3.21 3.44 ... ## ..$ qsec: num [1:32] 16.5 17 18.6 19.4 17 ... ## ..$ vs : num [1:32] 0 0 1 1 0 1 0 1 1 1 ... ## ..$ am : num [1:32] 1 1 1 0 0 0 0 0 0 0 ... ## ..$ gear: num [1:32] 4 4 4 3 3 3 3 4 4 4 ... ## ..$ carb: num [1:32] 4 4 1 1 2 1 4 2 2 4 ... ## $ iris :'data.frame': 150 obs. of 5 variables: ## ..$ Sepal.Length: num [1:150] 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... ## ..$ Sepal.Width : num [1:150] 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... ## ..$ Petal.Length: num [1:150] 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... ## ..$ Petal.Width : num [1:150] 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... ## ..$ Species : chr [1:150] \"setosa\" \"setosa\" \"setosa\" \"setosa\" ... export_list(m, \"%s.tsv\") c(\"mtcars.tsv\", \"iris.tsv\") %in% dir() ## [1] TRUE TRUE"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"guis","dir":"","previous_headings":"Other projects","what":"GUIs","title":"A Swiss-Army Knife for Data I/O","text":"rioweb provides access file conversion features rio. GREA RStudio add-provides interactive interface reading data using rio.","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"similar-packages","dir":"","previous_headings":"Other projects","what":"Similar packages","title":"A Swiss-Army Knife for Data I/O","text":"reader handles certain text formats R binary files io offers set custom formats ImportExport focuses select binary formats (Excel, SPSS, Access files) provides Shiny interface. SchemaOnRead iterates large number possible import methods one works successfully","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":null,"dir":"Reference","previous_headings":"","what":"Character conversion of labelled data — characterize","title":"Character conversion of labelled data — characterize","text":"Convert labelled variables character factor","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Character conversion of labelled data — characterize","text":"","code":"characterize(x, ...) factorize(x, ...) # S3 method for default characterize(x, ...) # S3 method for data.frame characterize(x, ...) # S3 method for default factorize(x, coerce_character = FALSE, ...) # S3 method for data.frame factorize(x, ...)"},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Character conversion of labelled data — characterize","text":"x vector data frame. ... additional arguments passed methods coerce_character logical indicating whether additionally coerce character columns factor (factorize). Default FALSE.","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Character conversion of labelled data — characterize","text":"character vector (characterize) factor vector (factorize)","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Character conversion of labelled data — characterize","text":"characterize converts vector labels attribute named levels character vector. factorize factors. can useful two stages data workflow: (1) importing labelled data metadata-rich file formats (e.g., Stata SPSS), (2) exporting data plain text files (e.g., CSV) way preserves information.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Character conversion of labelled data — characterize","text":"","code":"## vector method x <- structure(1:4, labels = c(\"A\" = 1, \"B\" = 2, \"C\" = 3)) characterize(x) #> [1] \"A\" \"B\" \"C\" NA factorize(x) #> [1] A B C #> Levels: A B C ## data frame method x <- data.frame(v1 = structure(1:4, labels = c(\"A\" = 1, \"B\" = 2, \"C\" = 3)), v2 = structure(c(1,0,0,1), labels = c(\"foo\" = 0, \"bar\" = 1))) str(factorize(x)) #> 'data.frame':\t4 obs. of 2 variables: #> $ v1: Factor w/ 3 levels \"A\",\"B\",\"C\": 1 2 3 NA #> $ v2: Factor w/ 2 levels \"foo\",\"bar\": 2 1 1 2 str(characterize(x)) #> 'data.frame':\t4 obs. of 2 variables: #> $ v1: chr \"A\" \"B\" \"C\" NA #> $ v2: chr \"bar\" \"foo\" \"foo\" \"bar\" ## Application csv_file <- tempfile(fileext = \".csv\") ## comparison of exported file contents import(export(x, csv_file)) #> v1 v2 #> 1 1 1 #> 2 2 0 #> 3 3 0 #> 4 4 1 import(export(factorize(x), csv_file)) #> v1 v2 #> 1 A bar #> 2 B foo #> 3 C foo #> 4 bar"},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert from one file format to another — convert","title":"Convert from one file format to another — convert","text":"function constructs data frame data file using import() uses export() write data disk format indicated file extension.","code":""},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert from one file format to another — convert","text":"","code":"convert(in_file, out_file, in_opts = list(), out_opts = list())"},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert from one file format to another — convert","text":"in_file character string naming input file. out_file character string naming output file. in_opts named list options passed import(). out_opts named list options passed export().","code":""},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert from one file format to another — convert","text":"character string containing name output file (invisibly).","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert from one file format to another — convert","text":"","code":"## For demo, a temp. file path is created with the file extension .dta (Stata) dta_file <- tempfile(fileext = \".dta\") ## .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## Create a Stata data file export(mtcars, dta_file) ## convert Stata to CSV and open converted file convert(dta_file, csv_file) import(csv_file) #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 ## correct an erroneous file format export(mtcars, xlsx_file, format = \"tsv\") ## DON'T DO THIS ## import(xlsx_file) ## ERROR ## convert the file by specifying `in_opts` convert(xlsx_file, xlsx_file, in_opts = list(format = \"tsv\")) import(xlsx_file) #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 ## convert from the command line: ## Rscript -e \"rio::convert('mtcars.dta', 'mtcars.csv')\""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export — export","title":"Export — export","text":"Write data.frame file","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export — export","text":"","code":"export(x, file, format, ...)"},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export — export","text":"x data frame, matrix single-item list data frame written file. Exceptions rule x can list multiple data frames output file format OpenDocument Spreadsheet (.ods, .fods), Excel .xlsx workbook, .Rdata file, HTML file, variety R objects output file format RDS JSON. See examples.) export list data frames multiple files, use export_list() instead. file character string naming file. Must specify file /format. format optional character string containing file format, can used override format inferred file , lieu specifying file, file symbol name x specified file extension created. Must specify file /format. Shortcuts include: “,” (comma-separated values), “;” (semicolon-separated values), “|” (pipe-separated values), “dump” base::dump(). ... Additional arguments underlying export functions. can used specify non-standard arguments. See examples.","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export — export","text":"name output file character string (invisibly).","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export — export","text":"function exports data frame matrix file file format based file extension (manually specified format, format specified). output file can compressed directory, simply adding appropriate additional extensiont file argument, : “mtcars.csv.tar”, “mtcars.csv.zip”, “mtcars.csv.gz”. export supports many file formats. See documentation underlying export functions optional arguments can passed via ... Comma-separated data (.csv), using data.table::fwrite() gzip comma-separated data (.csv.gz), using data.table::fwrite() Pipe-separated data (.psv), using data.table::fwrite() Tab-separated data (.tsv), using data.table::fwrite() SAS (.sas7bdat), using haven::write_sas(). SAS XPORT (.xpt), using haven::write_xpt(). SPSS (.sav), using haven::write_sav() SPSS compressed (.zsav), using haven::write_sav() Stata (.dta), using haven::write_dta(). Note variable/column names containing dots (.) allowed produce error. Excel (.xlsx), using writexl::write_xlsx(). x can also list data frames; list entry names used sheet names. R syntax object (.R), using base::dput() (default) base::dump() (format = 'dump') Saved R objects (.RData,.rda), using base::save(). case, x can data frame, named list objects, R environment, character vector containing names objects corresponding envir argument specified. Serialized R objects (.rds), using base::saveRDS(). case, x can serializable R object. Serialized R objects (.qs), using qs::qsave(), significantly faster .rds. can R object (just data frame). \"XBASE\" database files (.dbf), using foreign::write.dbf() Weka Attribute-Relation File Format (.arff), using foreign::write.arff() Fixed-width format data (.fwf), using utils::write.table() row.names = FALSE, quote = FALSE, col.names = FALSE CSVY (CSV YAML metadata header) using data.table::fwrite(). Apache Arrow Parquet (.parquet), using arrow::write_parquet() Feather R/Python interchange format (.feather), using arrow::write_feather() Fast storage (.fst), using fst::write.fst() JSON (.json), using jsonlite::toJSON(). case, x can variety R objects, based class mapping conventions paper: https://arxiv.org/abs/1403.2805. Matlab (.mat), using rmatio::write.mat() OpenDocument Spreadsheet (.ods, .fods), using readODS::write_ods() readODS::write_fods(). HTML (.html), using custom method based xml2::xml_add_child() create simple HTML table xml2::write_xml() write disk. XML (.xml), using custom method based xml2::xml_add_child() create simple XML tree xml2::write_xml() write disk. YAML (.yml), using yaml::write_yaml(), default write content UTF-8. Might work older systems, e.g. default Windows locale R <= 4.2. Clipboard export (Windows Mac OS), using utils::write.table() row.names = FALSE exporting data set contains label attributes (e.g., imported SPSS Stata file) plain text file, characterize() can useful pre-processing step records value labels resulting file (e.g., export(characterize(x), \"file.csv\")) rather numeric values. Use export_list() export list dataframes separate files.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export — export","text":"","code":"## For demo, a temp. file path is created with the file extension .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## create CSV to import export(iris, csv_file) ## You can certainly export your data with the file name, which is not a variable: ## import(mtcars, \"car_data.csv\") ## pass arguments to the underlying function ## data.table::fwrite is the underlying function and `col.names` is an argument export(iris, csv_file, col.names = FALSE) ## export a list of data frames as worksheets export(list(a = mtcars, b = iris), xlsx_file) # NOT RECOMMENDED ## specify `format` to override default format export(iris, xlsx_file, format = \"csv\") ## That's confusing ## You can also specify only the format; in the following case ## \"mtcars.dta\" is written [also confusing] ## export(mtcars, format = \"stata\")"},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Export list of data frames to files — export_list","title":"Export list of data frames to files — export_list","text":"Use export() export list data frames vector file names filename pattern.","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export list of data frames to files — export_list","text":"","code":"export_list(x, file, archive = \"\", ...)"},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export list of data frames to files — export_list","text":"x list data frames written files. file character vector string containing single file name \\%s wildcard placeholder, vector file paths multiple files imported. x elements named, used place \\%s, otherwise numbers used; elements must named names used. archive character. Either empty string (default) save files current directory, path (new) directory, .zip/.tar file compress files archive. ... Additional arguments passed export().","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export list of data frames to files — export_list","text":"name(s) output file(s) character vector (invisibly).","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export list of data frames to files — export_list","text":"export() can export list data frames single multi-dataset file (e.g., Rdata Excel .xlsx file). Use export_list export list multiple files.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export list of data frames to files — export_list","text":"","code":"## For demo, a temp. file path is created with the file extension .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") export( list( mtcars1 = mtcars[1:10, ], mtcars2 = mtcars[11:20, ], mtcars3 = mtcars[21:32, ] ), xlsx_file ) # import a single file from multi-object workbook import(xlsx_file, sheet = \"mtcars1\") #> 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 all worksheets, the return value is a list import_list(xlsx_file) #> $mtcars1 #> 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 #> #> $mtcars2 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 2 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 3 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 4 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 5 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 6 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 7 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 8 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 9 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 10 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> #> $mtcars3 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 2 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 3 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 4 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 5 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 6 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 7 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 8 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 9 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 10 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 11 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 12 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 #> library('datasets') export(list(mtcars1 = mtcars[1:10,], mtcars2 = mtcars[11:20,], mtcars3 = mtcars[21:32,]), xlsx_file <- tempfile(fileext = \".xlsx\") ) # import all worksheets list_of_dfs <- import_list(xlsx_file) # re-export as separate named files ## export_list(list_of_dfs, file = c(\"file1.csv\", \"file2.csv\", \"file3.csv\")) # re-export as separate files using a name pattern; using the names in the list ## This will be written as \"mtcars1.csv\", \"mtcars2.csv\", \"mtcars3.csv\" ## export_list(list_of_dfs, file = \"%s.csv\")"},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":null,"dir":"Reference","previous_headings":"","what":"Gather attributes from data frame variables — gather_attrs","title":"Gather attributes from data frame variables — gather_attrs","text":"gather_attrs moves variable-level attributes data frame level spread_attrs reverses operation.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gather attributes from data frame variables — gather_attrs","text":"","code":"gather_attrs(x) spread_attrs(x)"},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gather attributes from data frame variables — gather_attrs","text":"x data frame.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gather attributes from data frame variables — gather_attrs","text":"x, variable-level attributes stored data frame level.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gather attributes from data frame variables — gather_attrs","text":"import() attempts standardize return value various import functions extent possible, thus providing uniform data structure regardless import package function used. achieves storing optional variable-related attributes variable level (.e., attribute mtcars$mpg stored attributes(mtcars$mpg) rather attributes(mtcars)). gather_attrs moves data frame level (.e., attributes(mtcars)). spread_attrs moves attributes back variable level.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Get File Info — get_info","title":"Get File Info — get_info","text":"utility function retrieve file information filename, path, URL.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get File Info — get_info","text":"","code":"get_info(file) get_ext(file)"},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get File Info — get_info","text":"file character string containing filename, file path, URL.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get File Info — get_info","text":"get_info(), list return following slots input file extension information used identify possible file format format file format, see format argument import() type \"import\" (supported default); \"suggest\" (supported suggested packages, see install_formats()); \"enhance\" \"known \" directly supported; NA unsupported format_name name format import_function function used import file export_function function used export file file file get_ext(), just input (usually file extension) returned; retained backward compatibility.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get File Info — get_info","text":"","code":"get_info(\"starwars.xlsx\") #> $input #> [1] \"xlsx\" #> #> $format #> [1] \"xlsx\" #> #> $type #> [1] \"import\" #> #> $format_name #> [1] \"Excel\" #> #> $import_function #> [1] \"readxl::read_xlsx\" #> #> $export_function #> [1] \"writexl::write_xlsx\" #> #> $file #> [1] \"starwars.xlsx\" #> get_info(\"starwars.ods\") #> $input #> [1] \"ods\" #> #> $format #> [1] \"ods\" #> #> $type #> [1] \"suggest\" #> #> $format_name #> [1] \"OpenDocument Spreadsheet\" #> #> $import_function #> [1] \"readODS::read_ods\" #> #> $export_function #> [1] \"readODS::write_ods\" #> #> $file #> [1] \"starwars.ods\" #> get_info(\"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\") #> $input #> [1] \"ods\" #> #> $format #> [1] \"ods\" #> #> $type #> [1] \"suggest\" #> #> $format_name #> [1] \"OpenDocument Spreadsheet\" #> #> $import_function #> [1] \"readODS::read_ods\" #> #> $export_function #> [1] \"readODS::write_ods\" #> #> $file #> [1] \"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\" #> get_info(\"~/duran_duran_rio.mp3\") #> $input #> [1] \"mp3\" #> #> $format #> [1] NA #> #> $type #> [1] NA #> #> $format_name #> [1] NA #> #> $import_function #> [1] NA #> #> $export_function #> [1] NA #> #> $file #> [1] \"~/duran_duran_rio.mp3\" #> get_ext(\"clipboard\") ## \"clipboard\" #> [1] \"clipboard\" get_ext(\"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\") #> [1] \"ods\""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":null,"dir":"Reference","previous_headings":"","what":"Import — import","title":"Import — import","text":"Read data.frame file. Exceptions rule Rdata, RDS, JSON input file formats, return originally saved object without changing class.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import — import","text":"","code":"import( file, format, setclass = getOption(\"rio.import.class\", \"data.frame\"), which, ... )"},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import — import","text":"file character string naming file, URL, single-file .zip .tar archive. format optional character string code file format, can used override format inferred file. Shortcuts include: “,” (comma-separated values), “;” (semicolon-separated values), “|” (pipe-separated values). setclass optional character vector specifying one classes set import. default, return object always “data.frame”. Allowed values include “tbl_df”, “tbl”, “tibble” (using tibble), “arrow”, “arrow_table” (using arrow table; suggested package arrow must installed) “data.table” (using data.table). values ignored, data.frame returned. parameter takes precedents parameters ... set different class. argument used control import multi-object files; rule import ever returns single data frame (use import_list() import multiple data frames multi-object file). file compressed directory, can either character string specifying filename integer specifying file (locale sort order) extract compressed directory. Excel spreadsheets, can used specify sheet name number. .Rdata files, can object name. HTML files, identifies table extract (document order). Ignored otherwise. character string value used regular expression, extracted file first match regular expression file names archive. ... Additional arguments passed underlying import functions. example, can control column classes delimited file types, control use haven Stata SPSS readxl Excel (.xlsx) format. See details .","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import — import","text":"data frame. setclass used, data frame may additional class attribute values, “tibble” “data.table”.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import — import","text":"function imports data frame matrix data file file format based file extension (manually specified format, format specified). import supports following file formats: Comma-separated data (.csv), using data.table::fread() gzip comma-separated data (.csv.gz), using data.table::fread() Pipe-separated data (.psv), using data.table::fread() Tab-separated data (.tsv), using data.table::fread() SAS (.sas7bdat), using haven::read_sas() SAS XPORT (.xpt), using haven::read_xpt() SPSS (.sav), using haven::read_sav() SPSS compressed (.zsav), using haven::read_sav(). Stata (.dta), using haven::read_dta() SPSS Portable Files (.por), using haven::read_por(). Excel (.xls .xlsx), using readxl::read_xlsx() readxl::read_xls(). Use specify sheet number. R syntax object (.R), using base::dget(), see trust . Saved R objects (.RData,.rda), using base::load() single-object .Rdata files. Use specify object name multi-object .Rdata files. can R object (just data frame), see trust . Serialized R objects (.rds), using base::readRDS(). can R object (just data frame), see trust . Serialized R objects (.qs), using qs::qread(), significantly faster .rds. can R object (just data frame). Epiinfo (.rec), using foreign::read.epiinfo() Minitab (.mtp), using foreign::read.mtp() Systat (.syd), using foreign::read.systat() \"XBASE\" database files (.dbf), using foreign::read.dbf() Weka Attribute-Relation File Format (.arff), using foreign::read.arff() Data Interchange Format (.dif), using utils::read.DIF() Fortran data (recognized extension), using utils::read.fortran() Fixed-width format data (.fwf), using faster version utils::read.fwf() requires widths argument default rio stringsAsFactors = FALSE CSVY (CSV YAML metadata header) using data.table::fread(). Apache Arrow Parquet (.parquet), using arrow::read_parquet() Feather R/Python interchange format (.feather), using arrow::read_feather() Fast storage (.fst), using fst::read.fst() JSON (.json), using jsonlite::fromJSON() Matlab (.mat), using rmatio::read.mat() EViews (.wf1), using hexView::readEViews() OpenDocument Spreadsheet (.ods, .fods), using readODS::read_ods() readODS::read_fods(). Use specify sheet number. Single-table HTML documents (.html), using xml2::read_html(). standard HTML table tested HTML tables exported package. HTML tables read correctly HTML file can converted list via xml2::as_list(). import feature robust, especially HTML tables wild. Please use proper web scraping framework, e.g. rvest. Shallow XML documents (.xml), using xml2::read_xml(). data structure read correctly XML file can converted list via xml2::as_list(). YAML (.yml), using yaml::yaml.load() Clipboard import, using utils::read.table() row.names = FALSE Google Sheets, Comma-separated data (.csv) GraphPad Prism (.pzfx) using pzfx::read_pzfx() import attempts standardize return value various import functions extent possible, thus providing uniform data structure regardless import package function used. achieves storing optional variable-related attributes variable level (.e., attribute mtcars$mpg stored attributes(mtcars$mpg) rather attributes(mtcars)). prefer attributes stored data.frame-level (.e., attributes(mtcars)), see gather_attrs(). importing metadata-rich file formats (e.g., Stata SPSS), may helpful recode labelled variables character factor using characterize() factorize() respectively. serialization formats (.R, .RDS, .RData), please note load files trusted sources. formats necessarily storing rectangular data can also used store many things, e.g. code. Importing files lead arbitary code execution. Please read security principles R Project (Plummer, 2024). importing files via rio, affirm trust files, .e. trust = TRUE. See example . affirmation missing, current version assumes trust true backward compatibility deprecation notice printed. next major release (2.0.0), must explicitly affirm trust importing files.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import — import","text":"csv txt files row names exported export(), may helpful specify row.names column table contain row names. See example .","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Import — import","text":"Plummer, M (2024). Statement CVE-2024-27322. https://blog.r-project.org/2024/05/10/statement--cve-2024-27322/","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import — import","text":"","code":"## For demo, a temp. file path is created with the file extension .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## create CSV to import export(iris, csv_file) ## specify `format` to override default format: see export() export(iris, xlsx_file, format = \"csv\") ## basic import(csv_file) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica ## You can certainly import your data with the file name, which is not a variable: ## import(\"starwars.csv\"); import(\"mtcars.xlsx\") ## Override the default format ## import(xlsx_file) # Error, it is actually not an Excel file import(xlsx_file, format = \"csv\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica ## import CSV as a `data.table` import(csv_file, setclass = \"data.table\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> #> 1: 5.1 3.5 1.4 0.2 setosa #> 2: 4.9 3.0 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.0 3.6 1.4 0.2 setosa #> --- #> 146: 6.7 3.0 5.2 2.3 virginica #> 147: 6.3 2.5 5.0 1.9 virginica #> 148: 6.5 3.0 5.2 2.0 virginica #> 149: 6.2 3.4 5.4 2.3 virginica #> 150: 5.9 3.0 5.1 1.8 virginica ## import CSV as a tibble (or \"tbl_df\") import(csv_file, setclass = \"tbl_df\") #> # A tibble: 150 × 5 #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> #> 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 ## pass arguments to underlying import function ## data.table::fread is the underlying import function and `nrows` is its argument import(csv_file, nrows = 20) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa ## data.table::fread has an argument `data.table` to set the class explicitely to data.table. The ## argument setclass, however, takes precedents over such undocumented features. class(import(csv_file, setclass = \"tibble\", data.table = TRUE)) #> [1] \"tbl_df\" \"tbl\" \"data.frame\" ## the default import class can be set with options(rio.import.class = \"data.table\") ## options(rio.import.class = \"tibble\"), or options(rio.import.class = \"arrow\") ## Security rds_file <- tempfile(fileext = \".rds\") export(iris, rds_file) ## You should only import serialized formats from trusted sources ## In this case, you can trust it because it's generated by you. import(rds_file, trust = TRUE) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica"},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Import list of data frames — import_list","title":"Import list of data frames — import_list","text":"Use import() import list data frames vector file names multi-object file (Excel workbook, .Rdata file, zipped directory zip file, HTML file)","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import list of data frames — import_list","text":"","code":"import_list( file, setclass = getOption(\"rio.import.class\", \"data.frame\"), which, rbind = FALSE, rbind_label = \"_file\", rbind_fill = TRUE, ... )"},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import list of data frames — import_list","text":"file character string containing single file name multi-object file (e.g., Excel workbook, zip file, HTML file), vector file paths multiple files imported. setclass optional character vector specifying one classes set import. default, return object always “data.frame”. Allowed values include “tbl_df”, “tbl”, “tibble” (using tibble), “arrow”, “arrow_table” (using arrow table; suggested package arrow must installed) “data.table” (using data.table). values ignored, data.frame returned. parameter takes precedents parameters ... set different class. file single file path, specifies objects extracted (passed import()'s argument). Ignored otherwise. rbind logical indicating whether pass import list data frames data.table::rbindlist(). rbind_label rbind = TRUE, character string specifying name column add data frame indicating source file. rbind_fill rbind = TRUE, logical indicating whether set fill = TRUE (fill missing columns NA). ... Additional arguments passed import(). Behavior may unexpected files different formats.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import list of data frames — import_list","text":"rbind=FALSE (default), list data frames. Otherwise, list passed data.table::rbindlist() fill = TRUE returns data frame object class set setclass argument; operation fails, list returned.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import list of data frames — import_list","text":"file vector file paths files missing, files ignored (warnings) function raise error.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import list of data frames — import_list","text":"","code":"## For demo, a temp. file path is created with the file extension .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") export( list( mtcars1 = mtcars[1:10, ], mtcars2 = mtcars[11:20, ], mtcars3 = mtcars[21:32, ] ), xlsx_file ) # import a single file from multi-object workbook import(xlsx_file, sheet = \"mtcars1\") #> 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 all worksheets, the return value is a list import_list(xlsx_file) #> $mtcars1 #> 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 #> #> $mtcars2 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 2 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 3 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 4 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 5 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 6 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 7 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 8 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 9 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 10 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> #> $mtcars3 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 2 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 3 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 4 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 5 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 6 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 7 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 8 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 9 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 10 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 11 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 12 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 #> # import and rbind all worksheets, the return value is a data frame import_list(xlsx_file, rbind = TRUE) #> mpg cyl disp hp drat wt qsec vs am gear carb _file #> 1 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 1 #> 2 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 1 #> 3 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 1 #> 4 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 1 #> 5 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 1 #> 6 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 1 #> 7 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 1 #> 8 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 1 #> 9 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 1 #> 10 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 1 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 2 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 2 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 2 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 2 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 2 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 2 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 2 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 2 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 2 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 3 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 3 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 3 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 3 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 3 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 3 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 3 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 3 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 3 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 3 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 3 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 3"},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Install rio's ‘Suggests’ Dependencies — install_formats","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"function installs various ‘Suggests’ dependencies rio expand support full range support import export formats. packages installed loaded default order create slimmer faster package build, install, load.","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"","code":"install_formats(...)"},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"... Additional arguments passed utils::install.packages().","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"NULL","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"","code":"# \\donttest{ if (interactive()) { install_formats() } # }"},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":null,"dir":"Reference","previous_headings":"","what":"A Swiss-Army Knife for Data I/O — rio","title":"A Swiss-Army Knife for Data I/O — rio","text":"aim rio make data file input output easy possible. export() import() serve Swiss-army knife painless data /O data almost file format inferring data structure file extension, natively reading web-based data sources, setting reasonable defaults import export, relying efficient data import export packages. additional convenience function, convert(), provides simple method converting file types. Note rio's functionality provided ‘Suggests’ dependendencies, meaning installed default. Use install_formats() make sure packages available use.","code":""},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"A Swiss-Army Knife for Data I/O — rio","text":"GREA provides RStudio add-import data using rio.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A Swiss-Army Knife for Data I/O — rio","text":"Maintainer: Chung-hong Chan chainsawtiney@gmail.com (ORCID) Authors: Jason Becker jason@jbecker.co David Schoch david@schochastics.net (ORCID) Thomas J. Leeper thosjleeper@gmail.com (ORCID) contributors: Geoffrey CH Chan gefchchan@gmail.com [contributor] Christopher Gandrud [contributor] Andrew MacDonald [contributor] Ista Zahn [contributor] Stanislaus Stadlmann [contributor] Ruaridh Williamson ruaridh.williamson@gmail.com [contributor] Patrick Kennedy [contributor] Ryan Price ryapric@gmail.com [contributor] Trevor L Davis trevor.l.davis@gmail.com [contributor] Nathan Day nathancday@gmail.com [contributor] Bill Denney wdenney@humanpredictions.com (ORCID) [contributor] Alex Bokov alex.bokov@gmail.com (ORCID) [contributor]","code":""},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A Swiss-Army Knife for Data I/O — rio","text":"","code":"# export library(\"datasets\") export(mtcars, csv_file <- tempfile(fileext = \".csv\")) # comma-separated values export(mtcars, rds_file <- tempfile(fileext = \".rds\")) # R serialized export(mtcars, sav_file <- tempfile(fileext = \".sav\")) # SPSS # import x <- import(csv_file) y <- import(rds_file) #> Warning: The `trust` argument of `import()` should be explicit for serialization formats #> as of rio 1.0.3. #> ℹ Missing `trust` will be set to FALSE by default for RDS in 2.0.0. #> ℹ The deprecated feature was likely used in the rio package. #> Please report the issue at . z <- import(sav_file) # convert sav (SPSS) to dta (Stata) convert(sav_file, dta_file <- tempfile(fileext = \".dta\")) # cleanup unlink(c(csv_file, rds_file, sav_file, dta_file))"},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-103","dir":"Changelog","previous_headings":"","what":"rio 1.0.3","title":"rio 1.0.3","text":"Adds trust parameter functions used load various R environment formats (.R, .Rds, .Rdata, etc). parameter defaulted TRUE today ensure backwards compatibility. deprecation notice warns default FALSE rio 2.0. informing users data types loaded trusted sources, affirmatively attested .","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-102","dir":"Changelog","previous_headings":"","what":"rio 1.0.2","title":"rio 1.0.2","text":"missing files import_list gives informative warnings fix #389 Single-item list data frames can exported fix #385 Move stringi Suggests reduce compilation time. Add attribution internal data list required packages #378 Move readr Imports fwf. readr dependency haven increase number dependencies. Remove original read.fwf2 doesn’t guess widths. Keep widths col.names maintain compatibility. #381 Add (back) pkgdown website: https://gesistsa.github.io/rio/ Update test cases #380","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-101","dir":"Changelog","previous_headings":"","what":"rio 1.0.1","title":"rio 1.0.1","text":"CRAN release: 2023-09-19 POTENTIALLY BREAKING: Due compiling time concerns, roll back decision move arrow Imports. now Suggests. setclass = \"arrow\" works arrow installed. #315 #376","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-100","dir":"Changelog","previous_headings":"","what":"rio 1.0.0","title":"rio 1.0.0","text":"CRAN release: 2023-09-14 Stop loading entire namespace suggested package available #296 Unexport objects: .import, .export, is_file_text; remove documentation arg_reconcile #321 Update Examples make realistic #327 Add support qs #275 h/t David Schoch Use arrow import / export feather #340 export_list can write multiple data frames single archive file (e.g. zip, tar) directory #346 h/t David Schoch get_info added #350 POTENTIALLY BREAKING: setclass parameter now authoritative. Therefore: import(\"starwars.csv\", data.table = TRUE, setclass = \"tibble\") return tibble (unlike previous versions data.table returned). default class data frame. can either explicitly use setclass parameter; set option: options(rio.import.class = \"data.table\"). h/t David Schoch #336 Parquet feather now formats supported box; Possible setclass arrow / arrow_table; ArrowTabular class can exported #315 Add “extension”, “labelled” vignettes Support readODS 2.1.0 features reading writing Flat ODS; export Multiple data frames #358 POTENTIALLY BREAKING: Use writexl instead openxlsx. Option read xlsx openxlsx (.e. import(\"starwars.xlsx\", readxl = FALSE)) always TRUE. ability overwrite existing sheet existing xlsx file also removed. design principle rio. POTENTIALLY BREAKING: following options deprecated: import(fread), import(readr = TRUE), import(haven), import(readxl) export(fwrite). import almost use data.table, haven, readxl, internal function (fwf) import export data. Currently, options stay backward compatibility removed v2.0.0. #343 h/t David Schoch POTENTIALLY BREAKING: ... handled differently. Underlying functions using “Tidy” convention (e.g. readxl::read_xlsx()) can use “Base Convention” (See new vignette: remap). Unused arguments passed underlying function ... silently ignored default. new option rio.ignoreunusedargs added control behavior. #326 … correctly passed exporting ODS feather #318 POTENTIALLY BREAKING: JSON exported UTF-8 default; solved encoding issues Windows R < 4.2. won’t affect modern R installation UTF-8 default. #318 POTENTIALLY BREAKING: YAML exported using yaml::write_yaml(). can’t pass UTF-8 check older systems. Disclaimer added. #318 check file argument #301 import_list works single Excel/HTML/Zip online #294 Correct XML/HTML escaping #303 Create directory doesn’t exist #347 remove obsolete data.table option #323 write documentation blocks markdown #311 remove @importFrom #325 h/t David Schoch rearrange “Package Philosophy” Vignette #320 Create single source truth import export functions #313 Clarify concepts: now format #351 David Schoch @schochastics","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0530","dir":"Changelog","previous_headings":"","what":"rio 0.5.30","title":"rio 0.5.30","text":"CRAN release: 2023-08-29 Maintenance release: new maintainer Mark .sas7bdat deprecated Change minimum R version 3.6","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0529","dir":"Changelog","previous_headings":"","what":"rio 0.5.29","title":"rio 0.5.29","text":"CRAN release: 2021-11-22 fixes CRAN","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0528","dir":"Changelog","previous_headings":"","what":"rio 0.5.28","title":"rio 0.5.28","text":"Various fixes tests, examples, documentation CRAN. Temporarily disabled tests failed Mac M1s.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0527","dir":"Changelog","previous_headings":"","what":"rio 0.5.27","title":"rio 0.5.27","text":"CRAN release: 2021-06-21 Documentation fixes CRAN.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0526","dir":"Changelog","previous_headings":"","what":"rio 0.5.26","title":"rio 0.5.26","text":"CRAN release: 2021-03-01 Added support “zsav” format. (#273)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0525","dir":"Changelog","previous_headings":"","what":"rio 0.5.25","title":"rio 0.5.25","text":"Modified tests per email request CRAN. Added coerce_character argument (default FALSE) factorize() enable coercing character columns factor. (#278)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0524","dir":"Changelog","previous_headings":"","what":"rio 0.5.24","title":"rio 0.5.24","text":"Fix handling “label” “labels” attributes exporting using haven methods (SPSS, Stata, SAS). (#268, h/t Ruben Arslan) Fix (different bug?) handling factors haven::labelled() (#271, Alex Bokov) HTML import can now handle multiple tbody elements within single table, th element non-header row, empty elements either header data. (#260, #263, #264 Bill Denney)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0523","dir":"Changelog","previous_headings":"","what":"rio 0.5.23","title":"rio 0.5.23","text":"CSVY support now provided data.table::fread() data.table::fwrite(), providing significant performance gains. Added internal arg_reconcile() function streamline task removing/renaming arguments compatibility various functions (#245, Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0522","dir":"Changelog","previous_headings":"","what":"rio 0.5.22","title":"rio 0.5.22","text":"Added export_list() function write list data frames multiple files using vector file names file pattern. (#207, h/t Bill Denney) Added is_file_text() function determine whether file plain-text format. Optionally narrower subsets characters can specified, e.g. ASCII. (#236 Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0521","dir":"Changelog","previous_headings":"","what":"rio 0.5.21","title":"rio 0.5.21","text":"Added support Apache Arrow (Parquet) files. (#214) Fix dropping variable label characterize() factorize(). (#204, h/t David Armstrong) import_list() now returns filename attribute data frame list (importing multiple files), order distinguish files base name different extensions (e.g., import_list(c(\"foo.csv\", \"foo.tsv\"))). (#208, h/t Vimal Rawat) Import DBF files now convert strings factors. (#202, h/t @jllipatz) Implemented import() method .dump R files. (#240)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0520","dir":"Changelog","previous_headings":"","what":"rio 0.5.20","title":"rio 0.5.20","text":"Additional pointers added indicate load .doc, .docx, .pdf files (#210, h/t Bill Denney) Ensure tests run corresponding package installed. (h/t Bill Denney) Escape ampersands html xml export (#234 Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0519","dir":"Changelog","previous_headings":"","what":"rio 0.5.19","title":"rio 0.5.19","text":"Fix behavior export() plain text files append = TRUE (#201, h/t Julián Urbano) import_list() now preserve names Excel sheets, etc. ‘’ argument specified. (#162, h/t Danny Parsons) Modify message errors working unrecognized file formats. (#195, h/t Trevor Davis) Add support GraphPad Prism .pzfx files (#205, h/t Bill Denney)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0518","dir":"Changelog","previous_headings":"","what":"rio 0.5.18","title":"rio 0.5.18","text":"Adjust import()/export() JSON file formats allow non-data frame objects. Behavior modeled RDS format. (#199 h/t Nathan Day)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0517","dir":"Changelog","previous_headings":"","what":"rio 0.5.17","title":"rio 0.5.17","text":"Fix condition length > 1 first element used warning gather_attributes(). (#196, h/t Ruben Arslan)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0516","dir":"Changelog","previous_headings":"","what":"rio 0.5.16","title":"rio 0.5.16","text":"CRAN release: 2018-11-26 Fix condition length > 1 first element used warning standardize_attributes().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0515","dir":"Changelog","previous_headings":"","what":"rio 0.5.15","title":"rio 0.5.15","text":"CRAN release: 2018-11-25 Modified code produce compatibility haven 2.0.0 release. (#188) Add additional function suggestions ledger package. (#190, h/t Trevor Davis)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0514","dir":"Changelog","previous_headings":"","what":"rio 0.5.14","title":"rio 0.5.14","text":"Changes gather_attrs() haven 2.0.0 release. (#188) Fixed bug generated superfluous warning import(). style guide changes code.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0513","dir":"Changelog","previous_headings":"","what":"rio 0.5.13","title":"rio 0.5.13","text":"Allow import() objects data frames R-serialized (.rds .rdata) files. Also, export objects .rds files supported, previously intended. (#183, h/t Nicholas Jhirad) Added (suggests) support import EViews files using hexView::readEViews(). (#163, h/t Boris Demeshev) # rio 0.5.12 Add better package specification install_formats() reads Suggests field DESCRIPTION file. Edit header README.Rmd (thusly README.md) stop complaining lack title field. Fix typo CONTRIBUTING.md (line said “three arguments”, listed two).","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0511","dir":"Changelog","previous_headings":"","what":"rio 0.5.11","title":"rio 0.5.11","text":"Fixed bug import() wherein matlab files ignored unless format specified, well related bug made importing appear fail matlab files. (#171) Fixed bug export() wherein format ignored. (#99, h/t Sebastian Sauer) Fixed bug importing European-style semicolon-separated CSV files. Added test ensure correct behavior. (#159, h/t Kenneth Rose) Updated documentation reflect recent changes xlsx export() method. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0510","dir":"Changelog","previous_headings":"","what":"rio 0.5.10","title":"rio 0.5.10","text":"CRAN release: 2018-03-29 Removed csvy-related tests, failing CRAN.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-059","dir":"Changelog","previous_headings":"","what":"rio 0.5.9","title":"rio 0.5.9","text":"CRAN release: 2018-02-01 Removed longstanding warnings tests export() fixed-width format.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-058","dir":"Changelog","previous_headings":"","what":"rio 0.5.8","title":"rio 0.5.8","text":"Export get_ext() function. (#169) Fix bug related xml2 bug (#168, h/t Jim Hester) import_list() gains improved file name handling. (#164, h/t Ruaridh Williamson) Removed overwrite argument export() method xlsx files. Instead, existing workbooks always overwritten unless specified, case specified sheet (exists) overwritten. file exists sheet , data added new sheet existing workbook. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-057","dir":"Changelog","previous_headings":"","what":"rio 0.5.7","title":"rio 0.5.7","text":"Import files ambiguous .dat extension, typically text-delimited files, now passed data.table::fread() message. Export format remains unsupported. (#98, #155) Added support export SAS XPORT format (via haven::write_xpt()). (#157) Switched default import package SAS XPORT format haven::read_xpt() haven = FALSE toggle restoring previous default behavior using foreign::read.xpt(). (#157)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-056","dir":"Changelog","previous_headings":"","what":"rio 0.5.6","title":"rio 0.5.6","text":"Fixed bug import() compressed files wherein argument necessarily return correct file >=2 files compressed folder. Tweak handling export() xlsx workbooks specified. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-055","dir":"Changelog","previous_headings":"","what":"rio 0.5.5","title":"rio 0.5.5","text":"CRAN release: 2017-06-18 Expanded test suite increased test coverage, fixing tests failing certain CRAN builds.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-054","dir":"Changelog","previous_headings":"","what":"rio 0.5.4","title":"rio 0.5.4","text":"New functions characterize() factorize() provide methods converting “labelled” variables (e.g., Stata SPSS) character factor variables using embedded metadata. can also useful exporting metadata-rich file format plain text file. (#153)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-053","dir":"Changelog","previous_headings":"","what":"rio 0.5.3","title":"rio 0.5.3","text":"Fixed bug writing .zip .tar archives related absolute file paths. Fixed small bugs import_list() added tests behavior. Add .bib known-unsupported format via bib2df::bib2df(). Expanded test coverage.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-053-1","dir":"Changelog","previous_headings":"","what":"rio 0.5.3","title":"rio 0.5.3","text":"Fixed bug .import.rio_xlsx() readxl = FALSE. (#152, h/t Danny Parsons) Added new function spread_attrs() reverses gather_attrs() operation. Expanded test coverage.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-051","dir":"Changelog","previous_headings":"","what":"rio 0.5.1","title":"rio 0.5.1","text":"export() now sets variables “labels” attribute haven’s “labelled” class.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-050","dir":"Changelog","previous_headings":"","what":"rio 0.5.0","title":"rio 0.5.0","text":"CRAN release: 2017-04-28 CRAN Release. Restored import openxlsx writing xlsx supported install. (#150)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0428","dir":"Changelog","previous_headings":"","what":"rio 0.4.28","title":"rio 0.4.28","text":"Improved documentation mapping file format support packages used format. (#151, h/t Patrick Kennedy) import_list() now returns NULL entry failed imports, warning. (#149) import_list() gains additional arguments rbind_fill rbind_label control rbind-ing behavior. (#149)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0427","dir":"Changelog","previous_headings":"","what":"rio 0.4.27","title":"rio 0.4.27","text":"Import export clipboard now relies clipr::read_clip() clipr::write_clip(), respectively, thus (finally) providing Linux support. (#105, h/t Matthew Lincoln) Added rbind argument import_list(). (#149) Added setclass argument import_list(), ala import(). Switched requireNamespace() calls quietly = TRUE.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0426","dir":"Changelog","previous_headings":"","what":"rio 0.4.26","title":"rio 0.4.26","text":"fixes .csv.gz import/export. (#146, h/t Trevor Davis)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0425","dir":"Changelog","previous_headings":"","what":"rio 0.4.25","title":"rio 0.4.25","text":"Remove unecessary urltools dependency. New function import_list() returns list data frames multi-object Excel Workbook, .Rdata file, zip directory, HTML file. (#126, #129) export() can now write list data frames Excel (.xlsx) workbook. (#142, h/t Jeremy Johnson) export() can now write list data frames HTML (.html) file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0424","dir":"Changelog","previous_headings":"","what":"rio 0.4.24","title":"rio 0.4.24","text":"Verbosity export(format = \"fwf\") now depends options(\"verbose\"). Fixed various errors, warnings, messages fixed-width format tests. Modified defaults argument handling internal function read_delim(). Fixed handling “data.table”, “tibble”, “data.frame” classes set_class(). (#144)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0423","dir":"Changelog","previous_headings":"","what":"rio 0.4.23","title":"rio 0.4.23","text":"Moved non-critical format packages Suggests, rather Imports. (#143) Added support Matlab formats. (#78, #98) Added support fst format. (#138)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0422","dir":"Changelog","previous_headings":"","what":"rio 0.4.22","title":"rio 0.4.22","text":"Rearranged README. Bumped readxl dependency >= 0.1.1 (#130, h/t Yongfa Chen) Pass explicit excel_format arguments using readxl functions. (#130) Google Spreadsheets can now imported using allowed formats (CSV, TSV, XLSX, ODS). Added support writing ODS files via readODS::write_ods(). (#96)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0421","dir":"Changelog","previous_headings":"","what":"rio 0.4.21","title":"rio 0.4.21","text":"Handle HTML tables

elements. (h/t Mohamed Elgoussi)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0420","dir":"Changelog","previous_headings":"","what":"rio 0.4.20","title":"rio 0.4.20","text":"Fixed big .import.rio_xls() .import.rio_xlsx() sheet argument return error.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0419","dir":"Changelog","previous_headings":"","what":"rio 0.4.19","title":"rio 0.4.19","text":"Fixed bug import delimited files fread = FALSE. (#133, h/t Christopher Gandrud)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0418","dir":"Changelog","previous_headings":"","what":"rio 0.4.18","title":"rio 0.4.18","text":"new data.table release, export using fwrite() now default text-based file formats.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0417","dir":"Changelog","previous_headings":"","what":"rio 0.4.17","title":"rio 0.4.17","text":"Fixed bug .import.rio_xls() wherein argument ignored. (h/t Mohamed Elgoussi)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0416","dir":"Changelog","previous_headings":"","what":"rio 0.4.16","title":"rio 0.4.16","text":"CRAN release: 2016-09-25 Added support importing multi-table HTML files using argument. (#126)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0415","dir":"Changelog","previous_headings":"","what":"rio 0.4.15","title":"rio 0.4.15","text":"Improved behavior import() export() respect unrecognized file types. (#124, #125, h/t Jason Becker) Added explicit tests S3 extension mechanism .import() .export(). Attempt recognize compressed non-archived file formats (e.g., “.csv.gz”). (#123, h/t trevorld)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0414","dir":"Changelog","previous_headings":"","what":"rio 0.4.14","title":"rio 0.4.14","text":"Update import export methods use new xml2 XML HTML export. (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0413","dir":"Changelog","previous_headings":"","what":"rio 0.4.13","title":"rio 0.4.13","text":"Fix failing tests related stricter variable name handling Stata files development version haven. (#113, h/t Hadley Wickham) Added support export .sas7bdat files via haven (#116) Restored support import SPSS portable via haven (#116) Updated import methods reflect changed formal argument names haven. (#116) Converted roxygen2 documentation made NEWS explicit markdown file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0412","dir":"Changelog","previous_headings":"","what":"rio 0.4.12","title":"rio 0.4.12","text":"CRAN release: 2016-08-10 rio sets options(datatable.fread.dec.experiment=FALSE) onLoad address Unix-specific locale issue.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0411","dir":"Changelog","previous_headings":"","what":"rio 0.4.11","title":"rio 0.4.11","text":"CRAN release: 2016-08-09 Note unsupported NumPy /o via RcppCNPy. (#112) Fix import European-style CSV files (sep = “,” sep2 = “;”). (#106, #107, h/t Stani Stadlmann)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0410","dir":"Changelog","previous_headings":"","what":"rio 0.4.10","title":"rio 0.4.10","text":"Changed feather Imports Suggests make rio installable older R versions. (#104) Noted new RStudio add-, GREA, uses rio. (#109) Migrated CSVY-related code separate package (https://github.com/leeper/csvy/). (#111)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-049","dir":"Changelog","previous_headings":"","what":"rio 0.4.9","title":"rio 0.4.9","text":"Removed unnecessary error xlsx imports. (#103, h/t Kevin Wright)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-048","dir":"Changelog","previous_headings":"","what":"rio 0.4.8","title":"rio 0.4.8","text":"CRAN release: 2016-06-14 Fixed bug handling “labelled” class variables imported haven. (#102, h/t Pierre LaFortune)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-047","dir":"Changelog","previous_headings":"","what":"rio 0.4.7","title":"rio 0.4.7","text":"Improved use sep argument import delimited files. (#99, h/t Danny Parsons) Removed support import SPSS Portable (.por) files, given deprecation haven. (#100)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-045","dir":"Changelog","previous_headings":"","what":"rio 0.4.5","title":"rio 0.4.5","text":"CRAN release: 2016-05-20 Fixed tests remove (unimportant) warnings. Fixed failing test file compression found v0.4.3 platforms.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-043","dir":"Changelog","previous_headings":"","what":"rio 0.4.3","title":"rio 0.4.3","text":"CRAN release: 2016-05-19 Improved, generalized, tested, expanded documentation argument import(). Expanded test suite made small fixes.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-042","dir":"Changelog","previous_headings":"","what":"rio 0.4.2","title":"rio 0.4.2","text":"Added support import export feather data serialization format. (#88, h/t Jason Becker)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-041","dir":"Changelog","previous_headings":"","what":"rio 0.4.1","title":"rio 0.4.1","text":"Fixed behavior gather_attrs() data.frame attributes gather. (#94) Removed unrecognized file format error import compressed files. (#93)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-040","dir":"Changelog","previous_headings":"","what":"rio 0.4.0","title":"rio 0.4.0","text":"CRAN release: 2016-05-01 CRAN Release.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0319","dir":"Changelog","previous_headings":"","what":"rio 0.3.19","title":"rio 0.3.19","text":"Added gather_attrs() function moves variable-level attributes data.frame level. (#80) Added preliminary support import HTML tables (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0318","dir":"Changelog","previous_headings":"","what":"rio 0.3.18","title":"rio 0.3.18","text":"Added support export HTML tables. (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0317","dir":"Changelog","previous_headings":"","what":"rio 0.3.17","title":"rio 0.3.17","text":"Fixed bug import remote URLs incorrect file extensions.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0316","dir":"Changelog","previous_headings":"","what":"rio 0.3.16","title":"rio 0.3.16","text":"Added support import fixed-width format files via readr::read_fwf() specified widths argument. may enable faster import types files provides base-like interface working readr. (#48)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0315","dir":"Changelog","previous_headings":"","what":"rio 0.3.15","title":"rio 0.3.15","text":"Added support import export yaml. (#83) Fixed bug reading uncommented CSVY yaml header contained single-line comments. (#84, h/t Tom Aldenberg)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0314","dir":"Changelog","previous_headings":"","what":"rio 0.3.14","title":"rio 0.3.14","text":"Diagnostic messages cleaned facilitate translation. (#57)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0312","dir":"Changelog","previous_headings":"","what":"rio 0.3.12","title":"rio 0.3.12","text":".import() .export() now exported S3 generics documentation added describe write rio extensions new file types. example functionality shown new suggested “rio.db” package.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0311","dir":"Changelog","previous_headings":"","what":"rio 0.3.11","title":"rio 0.3.11","text":"import() now uses xml2 read XML structures export() uses custom method writing XML, thereby negating dependency XML package. (#67) Enhancements made import export CSVY store attribute metadata variable-level attributes (like imports binary file formats). import() gains argument used select file return within compressed tar zip archive. Export tar now tries correct bugs tar() fixed base R via PR#16716.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0310","dir":"Changelog","previous_headings":"","what":"rio 0.3.10","title":"rio 0.3.10","text":"Fixed bug import() (introduced #62, 7a7480e5) prevented import clipboard. (h/t Kevin Wright) export() returns character string. (#82)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-039","dir":"Changelog","previous_headings":"","what":"rio 0.3.9","title":"rio 0.3.9","text":"use import() SAS, Stata, SPSS files streamlined. Regardless whether haven = TRUE argument used, data.frame returned import() now (nearly) identical, attributes stored variable rather data.frame level. non-backwards compatible change. (#80)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-038","dir":"Changelog","previous_headings":"","what":"rio 0.3.8","title":"rio 0.3.8","text":"Fixed error export CSVY commented yaml header. (#81, h/t Andrew MacDonald)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-037","dir":"Changelog","previous_headings":"","what":"rio 0.3.7","title":"rio 0.3.7","text":"export() now allows automatic file compression tar, gzip, zip using file argument (e.g., export(iris, \"iris.csv.zip\")).","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-036","dir":"Changelog","previous_headings":"","what":"rio 0.3.6","title":"rio 0.3.6","text":"Expanded verbosity export() fixed-width format files added commented header containing column class width information. Exporting factors fixed-width format now saves values integer rather numeric. Expanded test suite separated tests format-specific files. (#51)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-035","dir":"Changelog","previous_headings":"","what":"rio 0.3.5","title":"rio 0.3.5","text":"Export CSVY files now includes commenting yaml header default. Import CSVY accommodates automatically. (#74)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-033","dir":"Changelog","previous_headings":"","what":"rio 0.3.3","title":"rio 0.3.3","text":"Export CSVY files metadata now supported export(). (#73) Import CSVY files now stores dataset-level metadata attributes output data.frame. (#73, h/t Tom Aldenberg) rio receives unrecognized file format, now issues message. new internal .import.default() .export.default() produce error. enables add-packages support additional formats new s3 methods form .import.rio_EXTENSION() .export.rio_EXTENSION().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-032","dir":"Changelog","previous_headings":"","what":"rio 0.3.2","title":"rio 0.3.2","text":"Use S3 dispatch internally call new (unexported) .import() .export() methods. (#42, h/t Jason Becker)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-030","dir":"Changelog","previous_headings":"","what":"rio 0.3.0","title":"rio 0.3.0","text":"CRAN release: 2016-01-14 Release CRAN. Set default numerical precision (2 decimal places) export fixed-width format.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0213","dir":"Changelog","previous_headings":"","what":"rio 0.2.13","title":"rio 0.2.13","text":"Import stats package na.omit().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0211","dir":"Changelog","previous_headings":"","what":"rio 0.2.11","title":"rio 0.2.11","text":"Added support direct import Google Sheets. (#60, #63, h/t Chung-hong Chan)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-027","dir":"Changelog","previous_headings":"","what":"rio 0.2.7","title":"rio 0.2.7","text":"Refactored remote file retrieval separate (non-exported) function used import(). (#62) Added test sutie test file conversion. Expanded test suite include test export formats.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-026","dir":"Changelog","previous_headings":"","what":"rio 0.2.6","title":"rio 0.2.6","text":"Cleaned NAMESPACE file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-025","dir":"Changelog","previous_headings":"","what":"rio 0.2.5","title":"rio 0.2.5","text":"file format remote file identified supplied URL final URL reported curl::curl_fetch_memory(), HTTP headers checked filename Content-Disposition header. (#36) Removed longurl dependency. longer needed can identify formats using curl’s url argument. Fixed bug related importing European-style (“csv2”) format files. (#44) Updated CSVY import embed variable-level metadata. (#52) Use urltools::url_parse() extract file extensions complex URLs (e.g., query arguments). (#56) Fixed NAMESPACE notes base packages. (#58)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-024","dir":"Changelog","previous_headings":"","what":"rio 0.2.4","title":"rio 0.2.4","text":"Modified behavior files imported using haven now store variable metadata data.frame level default (unlike default behavior haven, can cause problems). (#37, h/t Ista Zahn) Added support importing CSVY (http://csvy.org/) formatted files. (#52) Added import dependency data.table 1.9.5. (#39)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-022","dir":"Changelog","previous_headings":"","what":"rio 0.2.2","title":"rio 0.2.2","text":"Uses longurl package expand shortened URLs file type can easily determined.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-021","dir":"Changelog","previous_headings":"","what":"rio 0.2.1","title":"rio 0.2.1","text":"Improved support importing compressed directories, especially web-based compressed directories. (#38) Add import dependency curl >= 0.6 facilitate content type parsing format inference URL redirects. (#36) Add bit64 Suggests remove import warning.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-02","dir":"Changelog","previous_headings":"","what":"rio 0.2","title":"rio 0.2","text":"CRAN release: 2015-05-07 import always returns data.frame, unless setclass specified. (#22) Added support import legacy Excel (.xls) files readxl::read_excel, making use optional. (#19) Added support import export system clipboard Windows Mac OS. Added support export simple XML documents. (#12) Added support import simple XML documents via XML::xmlToDataFrame. (#12) Added support import ODS spreadsheet formats. (#12, h/t Chung-hong Chan) Use data.table::fread default reading delimited files. (#3) Added support import export dput dget objects. (#10) Added support reading compressed archives (.zip .tar). (#7) Added support writing fixed-width format. (#8) Set stringsAsFactors = FALSE default reading tabular data. (#4) Added support HTTPS imports. (#1, h/t Christopher Gandrud) Added support automatic file naming export based object name file format. (#5) Exposed convert function. Added vignette, knitr-generated README.md, updated documentation. (#2) Added non-exported functions simplify argument passing streamline package API. (#6) Separated import, export, convert, utilities separate source code files. Expanded set supported file types/extensions, switched SPSS, SAS, Stata formats haven, making use optional.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-012","dir":"Changelog","previous_headings":"","what":"rio 0.1.2","title":"rio 0.1.2","text":"CRAN release: 2013-09-04 Updated documentation fixed bug csv import without header.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-011","dir":"Changelog","previous_headings":"","what":"rio 0.1.1","title":"rio 0.1.1","text":"CRAN release: 2013-08-28 Initial release","code":""}] +[{"path":[]},{"path":"http://gesistsa.github.io/rio/articles/extension.html","id":"arff","dir":"Articles","previous_headings":"Examples","what":"arff","title":"Extending rio","text":"following example shows arff import export methods implemented internally.","code":".import.rio_arff <- function(file, which = 1, ...) { foreign::read.arff(file = file) } .export.rio_arff <- function(file, x, ...) { foreign::write.arff(x = x, file = file, ...) }"},{"path":"http://gesistsa.github.io/rio/articles/extension.html","id":"ledger","dir":"Articles","previous_headings":"Examples","what":"ledger","title":"Extending rio","text":"example ledger package (MIT) Dr Trevor L David .","code":".import.rio_ledger <- register # nolint register <- function(file, ..., toolchain = default_toolchain(file), date = NULL) { .assert_toolchain(toolchain) switch(toolchain, \"ledger\" = register_ledger(file, ..., date = date), \"hledger\" = register_hledger(file, ..., date = date), \"beancount\" = register_beancount(file, ..., date = date), \"bean-report_ledger\" = { file <- .bean_report(file, \"ledger\") on.exit(unlink(file)) register_ledger(file, ..., date = date) }, \"bean-report_hledger\" = { file <- .bean_report(file, \"hledger\") on.exit(unlink(file)) register_hledger(file, ..., date = date) } ) }"},{"path":"http://gesistsa.github.io/rio/articles/remap.html","id":"remapping","dir":"Articles","previous_headings":"","what":"Remapping","title":"Remapping and Ellipsis","text":"two conventions arguments among underlying functions used rio. Let’s call Base Convention “Tidy” Convention. rio can map Base Convention “Tidy” Convention (vice versa). can still use “Tidy” Convention, underlying function supports .","code":"library(rio) export(list(\"mtcars\" = mtcars, \"iris\" = iris), \"example.xlsx\") import(\"example.xlsx\", which = \"mtcars\") #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 import(\"example.xlsx\", sheet = \"mtcars\") #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"http://gesistsa.github.io/rio/articles/remap.html","id":"ellipsis-or-dot-dot-dot","dir":"Articles","previous_headings":"","what":"Ellipsis or “dot dot dot”","title":"Remapping and Ellipsis","text":"Additional parameters usually passed underlying function ellipsis (...). Parameters underlying function recognize silently ignored default. don’t like behavior, please change option rio.ignoreunusedargs FALSE, .e. options(rio.ignoreunusedargs = FALSE).","code":"## n_max is an argument of readxl::read_xlsx import(\"example.xlsx\", sheet = \"iris\", n_max = 10) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 import(\"example.xlsx\", sheet = \"iris\", n_max = 10, pizza = \"pineapple\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 options(rio.ignoreunusedargs = FALSE) import(\"example.xlsx\", sheet = \"iris\", n_max = 10, pizza = \"pineapple\") #> Error in (function (path, sheet = NULL, range = NULL, col_names = TRUE, : unused argument (pizza = \"pineapple\")"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"import-export-and-convert-data-files","dir":"Articles","previous_headings":"","what":"Import, Export, and Convert Data Files","title":"Import, Export, and Convert Data Files","text":"idea behind rio simplify process importing data R exporting data R. process , probably unnecessarily, extremely complex beginning R users. Indeed, R supplies entire manual describing process data import/export. , despite text, packages described (varying degrees) --date. Faster, simpler, packages fewer dependencies created many file types described document. rio aims unify data /O (importing exporting) two simple functions: import() export() beginners (experienced R users) never think twice (even ) best way read write R data. core advantage rio makes assumptions user probably willing make. Specifically, rio uses file extension file name determine kind file . logic used Windows OS, example, determining application associated given file type. taking away need manually match file type (beginner may recognize) particular import export function, rio allows almost common data formats read function. making import export easy, ’s obvious next step also use R simple data conversion utility. Transferring data files various proprietary formats always pain often expensive. convert function therefore combines import export easily convert file formats (thus providing FOSS replacement programs like Stat/Transfer Sledgehammer).","code":""},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"supported-file-formats","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Supported file formats","title":"Import, Export, and Convert Data Files","text":"rio supports variety different file formats import export. keep package slim, non-essential formats supported via “Suggests” packages, installed (loaded) default. ensure rio fully functional, install packages first time use rio via: full list supported formats : Additionally, format supported rio known R implementation produce informative error message pointing package import export function. Unrecognized formats yield simple “Unrecognized file format” error.","code":"install_formats()"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"data-import","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Data Import","title":"Import, Export, and Convert Data Files","text":"rio allows import files almost format using one, typically single-argument, function. import() infers file format file’s extension calls appropriate data import function , returning simple data.frame. works formats listed . reason file extension, file extension match actual type, can manually specify file format override format inference step. example, can read CSV file file extension specifying csv:","code":"library(\"rio\") x <- import(\"mtcars.csv\") y <- import(\"mtcars.dta\") # confirm identical all.equal(x, y, check.attributes = FALSE) ## [1] TRUE head(import(\"mtcars_noext\", format = \"csv\")) ## mpg cyl disp hp drat wt qsec vs am gear carb ## 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 ## 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 ## 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 ## 4 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 ## 5 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2 ## 6 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"importing-data-lists","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files > Data Import","what":"Importing Data Lists","title":"Import, Export, and Convert Data Files","text":"Sometimes may multiple data files want import. import() ever returns single data frame, import_list() can used import vector file names R. works even files different formats: Similarly, single-file formats (e.g. Excel Workbooks, Zip directories, HTML files, etc.) can contain multiple data sets. import() type safe, always returning data frame, importing formats requires specifying argument import() dictate data set (worksheet, file, table, etc.) import (default = 1). import_list() can used import (specified subset, via ) data objects types files.","code":"str(import_list(dir()), 1)"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"data-export","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"Data Export","title":"Import, Export, and Convert Data Files","text":"export capabilities rio somewhat limited import capabilities, given availability different functions various R packages import functions often written make use data applications never seems development priority functions export formats used applications. said, rio currently supports following formats: also easy use export() part R pipeline (magrittr dplyr). example, following code uses export() save results simple data transformation: file formats (e.g., Excel workbooks, Rdata files) can support multiple data objects single file. export() natively supports output multiple objects types files: also possible use new (v0.6.0) function export_list() write list data frames multiple files using either vector file names file pattern:","code":"library(\"rio\") export(mtcars, \"mtcars.csv\") export(mtcars, \"mtcars.dta\") library(\"magrittr\") mtcars %>% subset(hp > 100) %>% aggregate(. ~ cyl + am, data = ., FUN = mean) %>% export(file = \"mtcars2.dta\") # export to sheets of an Excel workbook export(list(mtcars = mtcars, iris = iris), \"multi.xlsx\") export_list(list(mtcars = mtcars, iris = iris), \"%s.tsv\")"},{"path":"http://gesistsa.github.io/rio/articles/rio.html","id":"file-conversion","dir":"Articles","previous_headings":"Import, Export, and Convert Data Files","what":"File Conversion","title":"Import, Export, and Convert Data Files","text":"convert() function links import() export() constructing dataframe imported file immediately writing back disk. convert() invisibly returns file name exported file, can used programmatically access new file. convert() just thin wrapper import() export(), easy use. example, can convert convert() also accepts lists arguments controlling import (in_opts) export (out_opts). can useful passing additional arguments import export methods. useful, example, reading fixed-width format file converting comma-separated values file: metadata-rich file formats (e.g., Stata, SPSS, SAS), can also useful pass imported data characterize() factorize() converting open, text-delimited format: characterize() converts single variable variables data frame “labels” attributes character vectors based mapping values value labels (e.g., export(characterize(import(\"file.dta\")), \"file.csv\")). alternative approach exporting CSVY format, records metadata YAML-formatted header beginning CSV file. also possible use rio command-line calling Rscript -e (expression) argument. example, convert file Stata (.dta) comma-separated values (.csv), simply following:","code":"# create file to convert export(mtcars, \"mtcars.dta\") # convert Stata to SPSS convert(\"mtcars.dta\", \"mtcars.sav\") # create an ambiguous file fwf <- tempfile(fileext = \".fwf\") cat(file = fwf, \"123456\", \"987654\", sep = \"\\n\") # see two ways to read in the file identical(import(fwf, widths = c(1, 2, 3)), import(fwf, widths = c(1, -2, 3))) ## Warning: The `widths` argument of `import()` is deprecated as of rio 1.0.2. ## ℹ `widths` is kept for backward compatibility. Please use `col_positions` or ## unset `widths` to allow automatic guessing, see `?readr::read_fwf`. The ## parameter `widths` will be dropped in v2.0.0. ## ℹ The deprecated feature was likely used in the rio package. ## Please report the issue at . ## This warning is displayed once every 8 hours. ## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was ## generated. ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ## [1] FALSE # convert to CSV convert(fwf, \"fwf.csv\", in_opts = list(widths = c(1, 2, 3))) ## Rows: 2 Columns: 3 ## ── Column specification ──────────────────────────────────────────────────────── ## ## dbl (3): X1, X2, X3 ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. import(\"fwf.csv\") # check conversion ## X1 X2 X3 ## 1 1 23 456 ## 2 9 87 654 Rscript -e \"rio::convert('mtcars.dta', 'mtcars.csv')\""},{"path":"http://gesistsa.github.io/rio/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Jason Becker. Author. Chung-hong Chan. Author, maintainer. David Schoch. Author. Geoffrey CH Chan. Contributor. Thomas J. Leeper. Author. Christopher Gandrud. Contributor. Andrew MacDonald. Contributor. Ista Zahn. Contributor. Stanislaus Stadlmann. Contributor. Ruaridh Williamson. Contributor. Patrick Kennedy. Contributor. Ryan Price. Contributor. Trevor L Davis. Contributor. Nathan Day. Contributor. Bill Denney. Contributor. Alex Bokov. Contributor.","code":""},{"path":"http://gesistsa.github.io/rio/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Chan C, Leeper T, Becker J, Schoch D (2023). rio: Swiss-army knife data file /O. https://cran.r-project.org/package=rio.","code":"@Manual{, title = {rio: A Swiss-army knife for data file I/O}, author = {Chung-hong Chan and Thomas J. Leeper and Jason Becker and David Schoch}, url = {https://cran.r-project.org/package=rio}, year = {2023}, }"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"A Swiss-Army Knife for Data I/O","text":"aim rio make data file /O R easy possible implementing two main functions Swiss-army knife style: import() provides painless data import experience automatically choosing appropriate import/read function based file extension (specified format argument) export() provides painless file recognition data export/write functionality","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"A Swiss-Army Knife for Data I/O","text":"package available CRAN can installed directly R using install.packages(). latest development version GitHub can installed using: Optional: Installation additional formats (see : Supported file formats)","code":"install.packages(\"rio\") if (!require(\"remotes\")){ install.packages(\"remotes\") } remotes::install_github(\"gesistsa/rio\") library(rio) install_formats()"},{"path":"http://gesistsa.github.io/rio/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"A Swiss-Army Knife for Data I/O","text":"rio meant streamline data /O, package extremely easy use. examples reading, writing, converting data files.","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"import","dir":"","previous_headings":"Usage","what":"Import","title":"A Swiss-Army Knife for Data I/O","text":"Importing data handled one function, import(): Note: inconsistencies across underlying packages, data.frame returned import might vary slightly (variable classes attributes) depending file type.","code":"library(\"rio\") import(\"starwars.xlsx\") ## Name homeworld species ## 1 Luke Skywalker Tatooine Human ## 2 C-3PO Tatooine Human ## 3 R2-D2 Alderaan Human ## 4 Darth Vader Tatooine Human ## 5 Leia Organa Tatooine Human ## 6 Owen Lars Tatooine Human ## 7 Beru Whitesun lars Stewjon Human ## 8 R5-D4 Tatooine Human ## 9 Biggs Darklighter Kashyyyk Wookiee ## 10 Obi-Wan Kenobi Corellia Human import(\"starwars.csv\") ## Name homeworld species ## 1 Luke Skywalker Tatooine Human ## 2 C-3PO Tatooine Human ## 3 R2-D2 Alderaan Human ## 4 Darth Vader Tatooine Human ## 5 Leia Organa Tatooine Human ## 6 Owen Lars Tatooine Human ## 7 Beru Whitesun lars Stewjon Human ## 8 R5-D4 Tatooine Human ## 9 Biggs Darklighter Kashyyyk Wookiee ## 10 Obi-Wan Kenobi Corellia Human"},{"path":"http://gesistsa.github.io/rio/index.html","id":"export","dir":"","previous_headings":"Usage","what":"Export","title":"A Swiss-Army Knife for Data I/O","text":"Exporting data handled one function, export(): particularly useful feature rio ability import export compressed (e.g., zip) directories, saving users extra step compressing large exported file, e.g.: export() can also write multiple data frames respective sheets Excel workbook HTML file:","code":"export(mtcars, \"mtcars.csv\") # comma-separated values export(mtcars, \"mtcars.rds\") # R serialized export(mtcars, \"mtcars.sav\") # SPSS export(mtcars, \"mtcars.tsv.zip\") export(list(mtcars = mtcars, iris = iris), file = \"mtcars.xlsx\")"},{"path":"http://gesistsa.github.io/rio/index.html","id":"supported-file-formats","dir":"","previous_headings":"","what":"Supported file formats","title":"A Swiss-Army Knife for Data I/O","text":"rio supports wide range file formats. keep package slim, several formats supported via “Suggests” packages, installed (loaded) default. ensure rio fully functional, install packages first time use rio via: full list supported formats : Additionally, format supported rio known R implementation produce informative error message pointing package import export function. Unrecognized formats yield simple “Unrecognized file format” error.","code":"install_formats()"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"convert","dir":"","previous_headings":"Other functions","what":"Convert","title":"A Swiss-Army Knife for Data I/O","text":"convert() function links import() export() constructing dataframe imported file immediately writing back disk. convert() invisibly returns file name exported file, can used programmatically access new file. also possible use rio command-line calling Rscript -e (expression) argument. example, convert file Stata (.dta) comma-separated values (.csv), simply following:","code":"convert(\"mtcars.sav\", \"mtcars.dta\") Rscript -e \"rio::convert('iris.dta', 'iris.csv')\""},{"path":"http://gesistsa.github.io/rio/index.html","id":"id__list","dir":"","previous_headings":"Other functions","what":"*_list","title":"A Swiss-Army Knife for Data I/O","text":"import_list() allows users import list data frames multi-object file (Excel workbook, .Rdata file, zip directory, HTML file): export_list() makes easy export list (possibly named) data frames multiple files:","code":"str(m <- import_list(\"mtcars.xlsx\")) ## List of 2 ## $ mtcars:'data.frame': 32 obs. of 11 variables: ## ..$ mpg : num [1:32] 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... ## ..$ cyl : num [1:32] 6 6 4 6 8 6 8 4 4 6 ... ## ..$ disp: num [1:32] 160 160 108 258 360 ... ## ..$ hp : num [1:32] 110 110 93 110 175 105 245 62 95 123 ... ## ..$ drat: num [1:32] 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ... ## ..$ wt : num [1:32] 2.62 2.88 2.32 3.21 3.44 ... ## ..$ qsec: num [1:32] 16.5 17 18.6 19.4 17 ... ## ..$ vs : num [1:32] 0 0 1 1 0 1 0 1 1 1 ... ## ..$ am : num [1:32] 1 1 1 0 0 0 0 0 0 0 ... ## ..$ gear: num [1:32] 4 4 4 3 3 3 3 4 4 4 ... ## ..$ carb: num [1:32] 4 4 1 1 2 1 4 2 2 4 ... ## $ iris :'data.frame': 150 obs. of 5 variables: ## ..$ Sepal.Length: num [1:150] 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... ## ..$ Sepal.Width : num [1:150] 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... ## ..$ Petal.Length: num [1:150] 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... ## ..$ Petal.Width : num [1:150] 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... ## ..$ Species : chr [1:150] \"setosa\" \"setosa\" \"setosa\" \"setosa\" ... export_list(m, \"%s.tsv\") c(\"mtcars.tsv\", \"iris.tsv\") %in% dir() ## [1] TRUE TRUE"},{"path":[]},{"path":"http://gesistsa.github.io/rio/index.html","id":"guis","dir":"","previous_headings":"Other projects","what":"GUIs","title":"A Swiss-Army Knife for Data I/O","text":"rioweb provides access file conversion features rio. GREA RStudio add-provides interactive interface reading data using rio.","code":""},{"path":"http://gesistsa.github.io/rio/index.html","id":"similar-packages","dir":"","previous_headings":"Other projects","what":"Similar packages","title":"A Swiss-Army Knife for Data I/O","text":"reader handles certain text formats R binary files io offers set custom formats ImportExport focuses select binary formats (Excel, SPSS, Access files) provides Shiny interface. SchemaOnRead iterates large number possible import methods one works successfully","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":null,"dir":"Reference","previous_headings":"","what":"Character conversion of labelled data — characterize","title":"Character conversion of labelled data — characterize","text":"Convert labelled variables character factor","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Character conversion of labelled data — characterize","text":"","code":"characterize(x, ...) factorize(x, ...) # S3 method for default characterize(x, ...) # S3 method for data.frame characterize(x, ...) # S3 method for default factorize(x, coerce_character = FALSE, ...) # S3 method for data.frame factorize(x, ...)"},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Character conversion of labelled data — characterize","text":"x vector data frame. ... additional arguments passed methods coerce_character logical indicating whether additionally coerce character columns factor (factorize). Default FALSE.","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Character conversion of labelled data — characterize","text":"character vector (characterize) factor vector (factorize)","code":""},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Character conversion of labelled data — characterize","text":"characterize converts vector labels attribute named levels character vector. factorize factors. can useful two stages data workflow: (1) importing labelled data metadata-rich file formats (e.g., Stata SPSS), (2) exporting data plain text files (e.g., CSV) way preserves information.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/characterize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Character conversion of labelled data — characterize","text":"","code":"## vector method x <- structure(1:4, labels = c(\"A\" = 1, \"B\" = 2, \"C\" = 3)) characterize(x) #> [1] \"A\" \"B\" \"C\" NA factorize(x) #> [1] A B C #> Levels: A B C ## data frame method x <- data.frame(v1 = structure(1:4, labels = c(\"A\" = 1, \"B\" = 2, \"C\" = 3)), v2 = structure(c(1,0,0,1), labels = c(\"foo\" = 0, \"bar\" = 1))) str(factorize(x)) #> 'data.frame':\t4 obs. of 2 variables: #> $ v1: Factor w/ 3 levels \"A\",\"B\",\"C\": 1 2 3 NA #> $ v2: Factor w/ 2 levels \"foo\",\"bar\": 2 1 1 2 str(characterize(x)) #> 'data.frame':\t4 obs. of 2 variables: #> $ v1: chr \"A\" \"B\" \"C\" NA #> $ v2: chr \"bar\" \"foo\" \"foo\" \"bar\" ## Application csv_file <- tempfile(fileext = \".csv\") ## comparison of exported file contents import(export(x, csv_file)) #> v1 v2 #> 1 1 1 #> 2 2 0 #> 3 3 0 #> 4 4 1 import(export(factorize(x), csv_file)) #> v1 v2 #> 1 A bar #> 2 B foo #> 3 C foo #> 4 bar"},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert from one file format to another — convert","title":"Convert from one file format to another — convert","text":"function constructs data frame data file using import() uses export() write data disk format indicated file extension.","code":""},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert from one file format to another — convert","text":"","code":"convert(in_file, out_file, in_opts = list(), out_opts = list())"},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert from one file format to another — convert","text":"in_file character string naming input file. out_file character string naming output file. in_opts named list options passed import(). out_opts named list options passed export().","code":""},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert from one file format to another — convert","text":"character string containing name output file (invisibly).","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/convert.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert from one file format to another — convert","text":"","code":"## For demo, a temp. file path is created with the file extension .dta (Stata) dta_file <- tempfile(fileext = \".dta\") ## .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## Create a Stata data file export(mtcars, dta_file) ## convert Stata to CSV and open converted file convert(dta_file, csv_file) import(csv_file) #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 ## correct an erroneous file format export(mtcars, xlsx_file, format = \"tsv\") ## DON'T DO THIS ## import(xlsx_file) ## ERROR ## convert the file by specifying `in_opts` convert(xlsx_file, xlsx_file, in_opts = list(format = \"tsv\")) import(xlsx_file) #> 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 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 ## convert from the command line: ## Rscript -e \"rio::convert('mtcars.dta', 'mtcars.csv')\""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":null,"dir":"Reference","previous_headings":"","what":"Export — export","title":"Export — export","text":"Write data.frame file","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export — export","text":"","code":"export(x, file, format, ...)"},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export — export","text":"x data frame, matrix single-item list data frame written file. Exceptions rule x can list multiple data frames output file format OpenDocument Spreadsheet (.ods, .fods), Excel .xlsx workbook, .Rdata file, HTML file, variety R objects output file format RDS JSON. See examples.) export list data frames multiple files, use export_list() instead. file character string naming file. Must specify file /format. format optional character string containing file format, can used override format inferred file , lieu specifying file, file symbol name x specified file extension created. Must specify file /format. Shortcuts include: “,” (comma-separated values), “;” (semicolon-separated values), “|” (pipe-separated values), “dump” base::dump(). ... Additional arguments underlying export functions. can used specify non-standard arguments. See examples.","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export — export","text":"name output file character string (invisibly).","code":""},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export — export","text":"function exports data frame matrix file file format based file extension (manually specified format, format specified). output file can compressed directory, simply adding appropriate additional extensiont file argument, : “mtcars.csv.tar”, “mtcars.csv.zip”, “mtcars.csv.gz”. export supports many file formats. See documentation underlying export functions optional arguments can passed via ... Comma-separated data (.csv), using data.table::fwrite() Pipe-separated data (.psv), using data.table::fwrite() Tab-separated data (.tsv), using data.table::fwrite() SAS (.sas7bdat), using haven::write_sas(). SAS XPORT (.xpt), using haven::write_xpt(). SPSS (.sav), using haven::write_sav() SPSS compressed (.zsav), using haven::write_sav() Stata (.dta), using haven::write_dta(). Note variable/column names containing dots (.) allowed produce error. Excel (.xlsx), using writexl::write_xlsx(). x can also list data frames; list entry names used sheet names. R syntax object (.R), using base::dput() (default) base::dump() (format = 'dump') Saved R objects (.RData,.rda), using base::save(). case, x can data frame, named list objects, R environment, character vector containing names objects corresponding envir argument specified. Serialized R objects (.rds), using base::saveRDS(). case, x can serializable R object. Serialized R objects (.qs), using qs::qsave(), significantly faster .rds. can R object (just data frame). \"XBASE\" database files (.dbf), using foreign::write.dbf() Weka Attribute-Relation File Format (.arff), using foreign::write.arff() Fixed-width format data (.fwf), using utils::write.table() row.names = FALSE, quote = FALSE, col.names = FALSE CSVY (CSV YAML metadata header) using data.table::fwrite(). Apache Arrow Parquet (.parquet), using arrow::write_parquet() Feather R/Python interchange format (.feather), using arrow::write_feather() Fast storage (.fst), using fst::write.fst() JSON (.json), using jsonlite::toJSON(). case, x can variety R objects, based class mapping conventions paper: https://arxiv.org/abs/1403.2805. Matlab (.mat), using rmatio::write.mat() OpenDocument Spreadsheet (.ods, .fods), using readODS::write_ods() readODS::write_fods(). HTML (.html), using custom method based xml2::xml_add_child() create simple HTML table xml2::write_xml() write disk. XML (.xml), using custom method based xml2::xml_add_child() create simple XML tree xml2::write_xml() write disk. YAML (.yml), using yaml::write_yaml(), default write content UTF-8. Might work older systems, e.g. default Windows locale R <= 4.2. Clipboard export (Windows Mac OS), using utils::write.table() row.names = FALSE exporting data set contains label attributes (e.g., imported SPSS Stata file) plain text file, characterize() can useful pre-processing step records value labels resulting file (e.g., export(characterize(x), \"file.csv\")) rather numeric values. Use export_list() export list dataframes separate files.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/export.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export — export","text":"","code":"## For demo, a temp. file path is created with the file extension .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## create CSV to import export(iris, csv_file) ## You can certainly export your data with the file name, which is not a variable: ## import(mtcars, \"car_data.csv\") ## pass arguments to the underlying function ## data.table::fwrite is the underlying function and `col.names` is an argument export(iris, csv_file, col.names = FALSE) ## export a list of data frames as worksheets export(list(a = mtcars, b = iris), xlsx_file) # NOT RECOMMENDED ## specify `format` to override default format export(iris, xlsx_file, format = \"csv\") ## That's confusing ## You can also specify only the format; in the following case ## \"mtcars.dta\" is written [also confusing] ## export(mtcars, format = \"stata\")"},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Export list of data frames to files — export_list","title":"Export list of data frames to files — export_list","text":"Use export() export list data frames vector file names filename pattern.","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export list of data frames to files — export_list","text":"","code":"export_list(x, file, archive = \"\", ...)"},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export list of data frames to files — export_list","text":"x list data frames written files. file character vector string containing single file name \\%s wildcard placeholder, vector file paths multiple files imported. x elements named, used place \\%s, otherwise numbers used; elements must named names used. archive character. Either empty string (default) save files current directory, path (new) directory, .zip/.tar file compress files archive. ... Additional arguments passed export().","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export list of data frames to files — export_list","text":"name(s) output file(s) character vector (invisibly).","code":""},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Export list of data frames to files — export_list","text":"export() can export list data frames single multi-dataset file (e.g., Rdata Excel .xlsx file). Use export_list export list multiple files.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/export_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Export list of data frames to files — export_list","text":"","code":"## For demo, a temp. file path is created with the file extension .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") export( list( mtcars1 = mtcars[1:10, ], mtcars2 = mtcars[11:20, ], mtcars3 = mtcars[21:32, ] ), xlsx_file ) # import a single file from multi-object workbook import(xlsx_file, sheet = \"mtcars1\") #> 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 all worksheets, the return value is a list import_list(xlsx_file) #> $mtcars1 #> 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 #> #> $mtcars2 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 2 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 3 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 4 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 5 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 6 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 7 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 8 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 9 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 10 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> #> $mtcars3 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 2 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 3 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 4 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 5 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 6 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 7 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 8 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 9 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 10 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 11 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 12 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 #> library('datasets') export(list(mtcars1 = mtcars[1:10,], mtcars2 = mtcars[11:20,], mtcars3 = mtcars[21:32,]), xlsx_file <- tempfile(fileext = \".xlsx\") ) # import all worksheets list_of_dfs <- import_list(xlsx_file) # re-export as separate named files ## export_list(list_of_dfs, file = c(\"file1.csv\", \"file2.csv\", \"file3.csv\")) # re-export as separate files using a name pattern; using the names in the list ## This will be written as \"mtcars1.csv\", \"mtcars2.csv\", \"mtcars3.csv\" ## export_list(list_of_dfs, file = \"%s.csv\")"},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":null,"dir":"Reference","previous_headings":"","what":"Gather attributes from data frame variables — gather_attrs","title":"Gather attributes from data frame variables — gather_attrs","text":"gather_attrs moves variable-level attributes data frame level spread_attrs reverses operation.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gather attributes from data frame variables — gather_attrs","text":"","code":"gather_attrs(x) spread_attrs(x)"},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gather attributes from data frame variables — gather_attrs","text":"x data frame.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gather attributes from data frame variables — gather_attrs","text":"x, variable-level attributes stored data frame level.","code":""},{"path":"http://gesistsa.github.io/rio/reference/gather_attrs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gather attributes from data frame variables — gather_attrs","text":"import() attempts standardize return value various import functions extent possible, thus providing uniform data structure regardless import package function used. achieves storing optional variable-related attributes variable level (.e., attribute mtcars$mpg stored attributes(mtcars$mpg) rather attributes(mtcars)). gather_attrs moves data frame level (.e., attributes(mtcars)). spread_attrs moves attributes back variable level.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Get File Info — get_info","title":"Get File Info — get_info","text":"utility function retrieve file information filename, path, URL.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get File Info — get_info","text":"","code":"get_info(file) get_ext(file)"},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get File Info — get_info","text":"file character string containing filename, file path, URL.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get File Info — get_info","text":"get_info(), list return following slots input file extension information used identify possible file format format file format, see format argument import() type \"import\" (supported default); \"suggest\" (supported suggested packages, see install_formats()); \"enhance\" \"known \" directly supported; NA unsupported format_name name format import_function function used import file export_function function used export file file file get_ext(), just input (usually file extension) returned; retained backward compatibility.","code":""},{"path":"http://gesistsa.github.io/rio/reference/get_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get File Info — get_info","text":"","code":"get_info(\"starwars.xlsx\") #> $input #> [1] \"xlsx\" #> #> $format #> [1] \"xlsx\" #> #> $type #> [1] \"import\" #> #> $format_name #> [1] \"Excel\" #> #> $import_function #> [1] \"readxl::read_xlsx\" #> #> $export_function #> [1] \"writexl::write_xlsx\" #> #> $file #> [1] \"starwars.xlsx\" #> get_info(\"starwars.ods\") #> $input #> [1] \"ods\" #> #> $format #> [1] \"ods\" #> #> $type #> [1] \"suggest\" #> #> $format_name #> [1] \"OpenDocument Spreadsheet\" #> #> $import_function #> [1] \"readODS::read_ods\" #> #> $export_function #> [1] \"readODS::write_ods\" #> #> $file #> [1] \"starwars.ods\" #> get_info(\"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\") #> $input #> [1] \"ods\" #> #> $format #> [1] \"ods\" #> #> $type #> [1] \"suggest\" #> #> $format_name #> [1] \"OpenDocument Spreadsheet\" #> #> $import_function #> [1] \"readODS::read_ods\" #> #> $export_function #> [1] \"readODS::write_ods\" #> #> $file #> [1] \"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\" #> get_info(\"~/duran_duran_rio.mp3\") #> $input #> [1] \"mp3\" #> #> $format #> [1] NA #> #> $type #> [1] NA #> #> $format_name #> [1] NA #> #> $import_function #> [1] NA #> #> $export_function #> [1] NA #> #> $file #> [1] \"~/duran_duran_rio.mp3\" #> get_ext(\"clipboard\") ## \"clipboard\" #> [1] \"clipboard\" get_ext(\"https://github.com/ropensci/readODS/raw/v2.1/starwars.ods\") #> [1] \"ods\""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":null,"dir":"Reference","previous_headings":"","what":"Import — import","title":"Import — import","text":"Read data.frame file. Exceptions rule Rdata, RDS, JSON input file formats, return originally saved object without changing class.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import — import","text":"","code":"import( file, format, setclass = getOption(\"rio.import.class\", \"data.frame\"), which, ... )"},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import — import","text":"file character string naming file, URL, single-file (can Gzip Bzip2 compressed), .zip .tar archive. format optional character string code file format, can used override format inferred file. Shortcuts include: “,” (comma-separated values), “;” (semicolon-separated values), “|” (pipe-separated values). setclass optional character vector specifying one classes set import. default, return object always “data.frame”. Allowed values include “tbl_df”, “tbl”, “tibble” (using tibble), “arrow”, “arrow_table” (using arrow table; suggested package arrow must installed) “data.table” (using data.table). values ignored, data.frame returned. parameter takes precedents parameters ... set different class. argument used control import multi-object files; rule import ever returns single data frame (use import_list() import multiple data frames multi-object file). file compressed directory, can either character string specifying filename integer specifying file (locale sort order) extract compressed directory. Excel spreadsheets, can used specify sheet name number. .Rdata files, can object name. HTML files, identifies table extract (document order). Ignored otherwise. character string value used regular expression, extracted file first match regular expression file names archive. ... Additional arguments passed underlying import functions. example, can control column classes delimited file types, control use haven Stata SPSS readxl Excel (.xlsx) format. See details .","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import — import","text":"data frame. setclass used, data frame may additional class attribute values, “tibble” “data.table”.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import — import","text":"function imports data frame matrix data file file format based file extension (manually specified format, format specified). import supports following file formats: Comma-separated data (.csv), using data.table::fread() Pipe-separated data (.psv), using data.table::fread() Tab-separated data (.tsv), using data.table::fread() SAS (.sas7bdat), using haven::read_sas() SAS XPORT (.xpt), using haven::read_xpt() SPSS (.sav), using haven::read_sav() SPSS compressed (.zsav), using haven::read_sav(). Stata (.dta), using haven::read_dta() SPSS Portable Files (.por), using haven::read_por(). Excel (.xls .xlsx), using readxl::read_xlsx() readxl::read_xls(). Use specify sheet number. R syntax object (.R), using base::dget(), see trust . Saved R objects (.RData,.rda), using base::load() single-object .Rdata files. Use specify object name multi-object .Rdata files. can R object (just data frame), see trust . Serialized R objects (.rds), using base::readRDS(). can R object (just data frame), see trust . Serialized R objects (.qs), using qs::qread(), significantly faster .rds. can R object (just data frame). Epiinfo (.rec), using foreign::read.epiinfo() Minitab (.mtp), using foreign::read.mtp() Systat (.syd), using foreign::read.systat() \"XBASE\" database files (.dbf), using foreign::read.dbf() Weka Attribute-Relation File Format (.arff), using foreign::read.arff() Data Interchange Format (.dif), using utils::read.DIF() Fortran data (recognized extension), using utils::read.fortran() Fixed-width format data (.fwf), using faster version utils::read.fwf() requires widths argument default rio stringsAsFactors = FALSE CSVY (CSV YAML metadata header) using data.table::fread(). Apache Arrow Parquet (.parquet), using arrow::read_parquet() Feather R/Python interchange format (.feather), using arrow::read_feather() Fast storage (.fst), using fst::read.fst() JSON (.json), using jsonlite::fromJSON() Matlab (.mat), using rmatio::read.mat() EViews (.wf1), using hexView::readEViews() OpenDocument Spreadsheet (.ods, .fods), using readODS::read_ods() readODS::read_fods(). Use specify sheet number. Single-table HTML documents (.html), using xml2::read_html(). standard HTML table tested HTML tables exported package. HTML tables read correctly HTML file can converted list via xml2::as_list(). import feature robust, especially HTML tables wild. Please use proper web scraping framework, e.g. rvest. Shallow XML documents (.xml), using xml2::read_xml(). data structure read correctly XML file can converted list via xml2::as_list(). YAML (.yml), using yaml::yaml.load() Clipboard import, using utils::read.table() row.names = FALSE Google Sheets, Comma-separated data (.csv) GraphPad Prism (.pzfx) using pzfx::read_pzfx() import attempts standardize return value various import functions extent possible, thus providing uniform data structure regardless import package function used. achieves storing optional variable-related attributes variable level (.e., attribute mtcars$mpg stored attributes(mtcars$mpg) rather attributes(mtcars)). prefer attributes stored data.frame-level (.e., attributes(mtcars)), see gather_attrs(). importing metadata-rich file formats (e.g., Stata SPSS), may helpful recode labelled variables character factor using characterize() factorize() respectively. serialization formats (.R, .RDS, .RData), please note load files trusted sources. formats necessarily storing rectangular data can also used store many things, e.g. code. Importing files lead arbitary code execution. Please read security principles R Project (Plummer, 2024). importing files via rio, affirm trust files, .e. trust = TRUE. See example . affirmation missing, current version assumes trust true backward compatibility deprecation notice printed. next major release (2.0.0), must explicitly affirm trust importing files.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Import — import","text":"csv txt files row names exported export(), may helpful specify row.names column table contain row names. See example .","code":""},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Import — import","text":"Plummer, M (2024). Statement CVE-2024-27322. https://blog.r-project.org/2024/05/10/statement--cve-2024-27322/","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/import.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import — import","text":"","code":"## For demo, a temp. file path is created with the file extension .csv csv_file <- tempfile(fileext = \".csv\") ## .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") ## create CSV to import export(iris, csv_file) ## specify `format` to override default format: see export() export(iris, xlsx_file, format = \"csv\") ## basic import(csv_file) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica ## You can certainly import your data with the file name, which is not a variable: ## import(\"starwars.csv\"); import(\"mtcars.xlsx\") ## Override the default format ## import(xlsx_file) # Error, it is actually not an Excel file import(xlsx_file, format = \"csv\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica ## import CSV as a `data.table` import(csv_file, setclass = \"data.table\") #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> #> 1: 5.1 3.5 1.4 0.2 setosa #> 2: 4.9 3.0 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.0 3.6 1.4 0.2 setosa #> --- #> 146: 6.7 3.0 5.2 2.3 virginica #> 147: 6.3 2.5 5.0 1.9 virginica #> 148: 6.5 3.0 5.2 2.0 virginica #> 149: 6.2 3.4 5.4 2.3 virginica #> 150: 5.9 3.0 5.1 1.8 virginica ## import CSV as a tibble (or \"tbl_df\") import(csv_file, setclass = \"tbl_df\") #> # A tibble: 150 × 5 #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> #> 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 ## pass arguments to underlying import function ## data.table::fread is the underlying import function and `nrows` is its argument import(csv_file, nrows = 20) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa ## data.table::fread has an argument `data.table` to set the class explicitely to data.table. The ## argument setclass, however, takes precedents over such undocumented features. class(import(csv_file, setclass = \"tibble\", data.table = TRUE)) #> [1] \"tbl_df\" \"tbl\" \"data.frame\" ## the default import class can be set with options(rio.import.class = \"data.table\") ## options(rio.import.class = \"tibble\"), or options(rio.import.class = \"arrow\") ## Security rds_file <- tempfile(fileext = \".rds\") export(iris, rds_file) ## You should only import serialized formats from trusted sources ## In this case, you can trust it because it's generated by you. import(rds_file, trust = TRUE) #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 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.0 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.0 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 #> 11 5.4 3.7 1.5 0.2 setosa #> 12 4.8 3.4 1.6 0.2 setosa #> 13 4.8 3.0 1.4 0.1 setosa #> 14 4.3 3.0 1.1 0.1 setosa #> 15 5.8 4.0 1.2 0.2 setosa #> 16 5.7 4.4 1.5 0.4 setosa #> 17 5.4 3.9 1.3 0.4 setosa #> 18 5.1 3.5 1.4 0.3 setosa #> 19 5.7 3.8 1.7 0.3 setosa #> 20 5.1 3.8 1.5 0.3 setosa #> 21 5.4 3.4 1.7 0.2 setosa #> 22 5.1 3.7 1.5 0.4 setosa #> 23 4.6 3.6 1.0 0.2 setosa #> 24 5.1 3.3 1.7 0.5 setosa #> 25 4.8 3.4 1.9 0.2 setosa #> 26 5.0 3.0 1.6 0.2 setosa #> 27 5.0 3.4 1.6 0.4 setosa #> 28 5.2 3.5 1.5 0.2 setosa #> 29 5.2 3.4 1.4 0.2 setosa #> 30 4.7 3.2 1.6 0.2 setosa #> 31 4.8 3.1 1.6 0.2 setosa #> 32 5.4 3.4 1.5 0.4 setosa #> 33 5.2 4.1 1.5 0.1 setosa #> 34 5.5 4.2 1.4 0.2 setosa #> 35 4.9 3.1 1.5 0.2 setosa #> 36 5.0 3.2 1.2 0.2 setosa #> 37 5.5 3.5 1.3 0.2 setosa #> 38 4.9 3.6 1.4 0.1 setosa #> 39 4.4 3.0 1.3 0.2 setosa #> 40 5.1 3.4 1.5 0.2 setosa #> 41 5.0 3.5 1.3 0.3 setosa #> 42 4.5 2.3 1.3 0.3 setosa #> 43 4.4 3.2 1.3 0.2 setosa #> 44 5.0 3.5 1.6 0.6 setosa #> 45 5.1 3.8 1.9 0.4 setosa #> 46 4.8 3.0 1.4 0.3 setosa #> 47 5.1 3.8 1.6 0.2 setosa #> 48 4.6 3.2 1.4 0.2 setosa #> 49 5.3 3.7 1.5 0.2 setosa #> 50 5.0 3.3 1.4 0.2 setosa #> 51 7.0 3.2 4.7 1.4 versicolor #> 52 6.4 3.2 4.5 1.5 versicolor #> 53 6.9 3.1 4.9 1.5 versicolor #> 54 5.5 2.3 4.0 1.3 versicolor #> 55 6.5 2.8 4.6 1.5 versicolor #> 56 5.7 2.8 4.5 1.3 versicolor #> 57 6.3 3.3 4.7 1.6 versicolor #> 58 4.9 2.4 3.3 1.0 versicolor #> 59 6.6 2.9 4.6 1.3 versicolor #> 60 5.2 2.7 3.9 1.4 versicolor #> 61 5.0 2.0 3.5 1.0 versicolor #> 62 5.9 3.0 4.2 1.5 versicolor #> 63 6.0 2.2 4.0 1.0 versicolor #> 64 6.1 2.9 4.7 1.4 versicolor #> 65 5.6 2.9 3.6 1.3 versicolor #> 66 6.7 3.1 4.4 1.4 versicolor #> 67 5.6 3.0 4.5 1.5 versicolor #> 68 5.8 2.7 4.1 1.0 versicolor #> 69 6.2 2.2 4.5 1.5 versicolor #> 70 5.6 2.5 3.9 1.1 versicolor #> 71 5.9 3.2 4.8 1.8 versicolor #> 72 6.1 2.8 4.0 1.3 versicolor #> 73 6.3 2.5 4.9 1.5 versicolor #> 74 6.1 2.8 4.7 1.2 versicolor #> 75 6.4 2.9 4.3 1.3 versicolor #> 76 6.6 3.0 4.4 1.4 versicolor #> 77 6.8 2.8 4.8 1.4 versicolor #> 78 6.7 3.0 5.0 1.7 versicolor #> 79 6.0 2.9 4.5 1.5 versicolor #> 80 5.7 2.6 3.5 1.0 versicolor #> 81 5.5 2.4 3.8 1.1 versicolor #> 82 5.5 2.4 3.7 1.0 versicolor #> 83 5.8 2.7 3.9 1.2 versicolor #> 84 6.0 2.7 5.1 1.6 versicolor #> 85 5.4 3.0 4.5 1.5 versicolor #> 86 6.0 3.4 4.5 1.6 versicolor #> 87 6.7 3.1 4.7 1.5 versicolor #> 88 6.3 2.3 4.4 1.3 versicolor #> 89 5.6 3.0 4.1 1.3 versicolor #> 90 5.5 2.5 4.0 1.3 versicolor #> 91 5.5 2.6 4.4 1.2 versicolor #> 92 6.1 3.0 4.6 1.4 versicolor #> 93 5.8 2.6 4.0 1.2 versicolor #> 94 5.0 2.3 3.3 1.0 versicolor #> 95 5.6 2.7 4.2 1.3 versicolor #> 96 5.7 3.0 4.2 1.2 versicolor #> 97 5.7 2.9 4.2 1.3 versicolor #> 98 6.2 2.9 4.3 1.3 versicolor #> 99 5.1 2.5 3.0 1.1 versicolor #> 100 5.7 2.8 4.1 1.3 versicolor #> 101 6.3 3.3 6.0 2.5 virginica #> 102 5.8 2.7 5.1 1.9 virginica #> 103 7.1 3.0 5.9 2.1 virginica #> 104 6.3 2.9 5.6 1.8 virginica #> 105 6.5 3.0 5.8 2.2 virginica #> 106 7.6 3.0 6.6 2.1 virginica #> 107 4.9 2.5 4.5 1.7 virginica #> 108 7.3 2.9 6.3 1.8 virginica #> 109 6.7 2.5 5.8 1.8 virginica #> 110 7.2 3.6 6.1 2.5 virginica #> 111 6.5 3.2 5.1 2.0 virginica #> 112 6.4 2.7 5.3 1.9 virginica #> 113 6.8 3.0 5.5 2.1 virginica #> 114 5.7 2.5 5.0 2.0 virginica #> 115 5.8 2.8 5.1 2.4 virginica #> 116 6.4 3.2 5.3 2.3 virginica #> 117 6.5 3.0 5.5 1.8 virginica #> 118 7.7 3.8 6.7 2.2 virginica #> 119 7.7 2.6 6.9 2.3 virginica #> 120 6.0 2.2 5.0 1.5 virginica #> 121 6.9 3.2 5.7 2.3 virginica #> 122 5.6 2.8 4.9 2.0 virginica #> 123 7.7 2.8 6.7 2.0 virginica #> 124 6.3 2.7 4.9 1.8 virginica #> 125 6.7 3.3 5.7 2.1 virginica #> 126 7.2 3.2 6.0 1.8 virginica #> 127 6.2 2.8 4.8 1.8 virginica #> 128 6.1 3.0 4.9 1.8 virginica #> 129 6.4 2.8 5.6 2.1 virginica #> 130 7.2 3.0 5.8 1.6 virginica #> 131 7.4 2.8 6.1 1.9 virginica #> 132 7.9 3.8 6.4 2.0 virginica #> 133 6.4 2.8 5.6 2.2 virginica #> 134 6.3 2.8 5.1 1.5 virginica #> 135 6.1 2.6 5.6 1.4 virginica #> 136 7.7 3.0 6.1 2.3 virginica #> 137 6.3 3.4 5.6 2.4 virginica #> 138 6.4 3.1 5.5 1.8 virginica #> 139 6.0 3.0 4.8 1.8 virginica #> 140 6.9 3.1 5.4 2.1 virginica #> 141 6.7 3.1 5.6 2.4 virginica #> 142 6.9 3.1 5.1 2.3 virginica #> 143 5.8 2.7 5.1 1.9 virginica #> 144 6.8 3.2 5.9 2.3 virginica #> 145 6.7 3.3 5.7 2.5 virginica #> 146 6.7 3.0 5.2 2.3 virginica #> 147 6.3 2.5 5.0 1.9 virginica #> 148 6.5 3.0 5.2 2.0 virginica #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica"},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Import list of data frames — import_list","title":"Import list of data frames — import_list","text":"Use import() import list data frames vector file names multi-object file (Excel workbook, .Rdata file, zipped directory zip file, HTML file)","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import list of data frames — import_list","text":"","code":"import_list( file, setclass = getOption(\"rio.import.class\", \"data.frame\"), which, rbind = FALSE, rbind_label = \"_file\", rbind_fill = TRUE, ... )"},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import list of data frames — import_list","text":"file character string containing single file name multi-object file (e.g., Excel workbook, zip file, HTML file), vector file paths multiple files imported. setclass optional character vector specifying one classes set import. default, return object always “data.frame”. Allowed values include “tbl_df”, “tbl”, “tibble” (using tibble), “arrow”, “arrow_table” (using arrow table; suggested package arrow must installed) “data.table” (using data.table). values ignored, data.frame returned. parameter takes precedents parameters ... set different class. file single file path, specifies objects extracted (passed import()'s argument). Ignored otherwise. rbind logical indicating whether pass import list data frames data.table::rbindlist(). rbind_label rbind = TRUE, character string specifying name column add data frame indicating source file. rbind_fill rbind = TRUE, logical indicating whether set fill = TRUE (fill missing columns NA). ... Additional arguments passed import(). Behavior may unexpected files different formats.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import list of data frames — import_list","text":"rbind=FALSE (default), list data frames. Otherwise, list passed data.table::rbindlist() fill = TRUE returns data frame object class set setclass argument; operation fails, list returned.","code":""},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Import list of data frames — import_list","text":"file vector file paths files missing, files ignored (warnings) function raise error.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/import_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Import list of data frames — import_list","text":"","code":"## For demo, a temp. file path is created with the file extension .xlsx xlsx_file <- tempfile(fileext = \".xlsx\") export( list( mtcars1 = mtcars[1:10, ], mtcars2 = mtcars[11:20, ], mtcars3 = mtcars[21:32, ] ), xlsx_file ) # import a single file from multi-object workbook import(xlsx_file, sheet = \"mtcars1\") #> 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 all worksheets, the return value is a list import_list(xlsx_file) #> $mtcars1 #> 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 #> #> $mtcars2 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> 2 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> 3 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> 4 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> 5 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> 6 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> 7 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> 8 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> 9 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> 10 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> #> $mtcars3 #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> 2 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> 3 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> 4 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> 5 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> 6 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> 7 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> 8 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> 9 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> 10 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> 11 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> 12 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 #> # import and rbind all worksheets, the return value is a data frame import_list(xlsx_file, rbind = TRUE) #> mpg cyl disp hp drat wt qsec vs am gear carb _file #> 1 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 1 #> 2 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 1 #> 3 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 1 #> 4 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 1 #> 5 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 1 #> 6 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 1 #> 7 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 1 #> 8 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 1 #> 9 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 1 #> 10 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 1 #> 11 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 2 #> 12 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 2 #> 13 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 2 #> 14 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 2 #> 15 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 2 #> 16 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 2 #> 17 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 2 #> 18 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 2 #> 19 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 2 #> 20 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 2 #> 21 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 3 #> 22 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 3 #> 23 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 3 #> 24 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 3 #> 25 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 3 #> 26 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 3 #> 27 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 3 #> 28 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 3 #> 29 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 3 #> 30 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 3 #> 31 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 3 #> 32 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2 3"},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":null,"dir":"Reference","previous_headings":"","what":"Install rio's ‘Suggests’ Dependencies — install_formats","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"function installs various ‘Suggests’ dependencies rio expand support full range support import export formats. packages installed loaded default order create slimmer faster package build, install, load.","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"","code":"install_formats(...)"},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"... Additional arguments passed utils::install.packages().","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"NULL","code":""},{"path":"http://gesistsa.github.io/rio/reference/install_formats.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Install rio's ‘Suggests’ Dependencies — install_formats","text":"","code":"# \\donttest{ if (interactive()) { install_formats() } # }"},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":null,"dir":"Reference","previous_headings":"","what":"A Swiss-Army Knife for Data I/O — rio","title":"A Swiss-Army Knife for Data I/O — rio","text":"aim rio make data file input output easy possible. export() import() serve Swiss-army knife painless data /O data almost file format inferring data structure file extension, natively reading web-based data sources, setting reasonable defaults import export, relying efficient data import export packages. additional convenience function, convert(), provides simple method converting file types. Note rio's functionality provided ‘Suggests’ dependendencies, meaning installed default. Use install_formats() make sure packages available use.","code":""},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"A Swiss-Army Knife for Data I/O — rio","text":"GREA provides RStudio add-import data using rio.","code":""},{"path":[]},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A Swiss-Army Knife for Data I/O — rio","text":"Maintainer: Chung-hong Chan chainsawtiney@gmail.com (ORCID) Authors: Jason Becker jason@jbecker.co David Schoch david@schochastics.net (ORCID) Thomas J. Leeper thosjleeper@gmail.com (ORCID) contributors: Geoffrey CH Chan gefchchan@gmail.com [contributor] Christopher Gandrud [contributor] Andrew MacDonald [contributor] Ista Zahn [contributor] Stanislaus Stadlmann [contributor] Ruaridh Williamson ruaridh.williamson@gmail.com [contributor] Patrick Kennedy [contributor] Ryan Price ryapric@gmail.com [contributor] Trevor L Davis trevor.l.davis@gmail.com [contributor] Nathan Day nathancday@gmail.com [contributor] Bill Denney wdenney@humanpredictions.com (ORCID) [contributor] Alex Bokov alex.bokov@gmail.com (ORCID) [contributor]","code":""},{"path":"http://gesistsa.github.io/rio/reference/rio.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"A Swiss-Army Knife for Data I/O — rio","text":"","code":"# export library(\"datasets\") export(mtcars, csv_file <- tempfile(fileext = \".csv\")) # comma-separated values export(mtcars, rds_file <- tempfile(fileext = \".rds\")) # R serialized export(mtcars, sav_file <- tempfile(fileext = \".sav\")) # SPSS # import x <- import(csv_file) y <- import(rds_file) #> Warning: The `trust` argument of `import()` should be explicit for serialization formats #> as of rio 1.0.3. #> ℹ Missing `trust` will be set to FALSE by default for RDS in 2.0.0. #> ℹ The deprecated feature was likely used in the rio package. #> Please report the issue at . z <- import(sav_file) # convert sav (SPSS) to dta (Stata) convert(sav_file, dta_file <- tempfile(fileext = \".dta\")) # cleanup unlink(c(csv_file, rds_file, sav_file, dta_file))"},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-103","dir":"Changelog","previous_headings":"","what":"rio 1.0.3","title":"rio 1.0.3","text":"Add trust parameter functions used load various R environment formats (.R, .Rds, .Rdata, etc). parameter defaulted TRUE today ensure backwards compatibility. deprecation notice warns default FALSE rio 2.0. informing users data types loaded trusted sources, affirmatively attested . Test fix compression mechanism: Gzip, Bzip2 now working expected.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-102","dir":"Changelog","previous_headings":"","what":"rio 1.0.2","title":"rio 1.0.2","text":"missing files import_list gives informative warnings fix #389 Single-item list data frames can exported fix #385 Move stringi Suggests reduce compilation time. Add attribution internal data list required packages #378 Move readr Imports fwf. readr dependency haven increase number dependencies. Remove original read.fwf2 doesn’t guess widths. Keep widths col.names maintain compatibility. #381 Add (back) pkgdown website: https://gesistsa.github.io/rio/ Update test cases #380","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-101","dir":"Changelog","previous_headings":"","what":"rio 1.0.1","title":"rio 1.0.1","text":"CRAN release: 2023-09-19 POTENTIALLY BREAKING: Due compiling time concerns, roll back decision move arrow Imports. now Suggests. setclass = \"arrow\" works arrow installed. #315 #376","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-100","dir":"Changelog","previous_headings":"","what":"rio 1.0.0","title":"rio 1.0.0","text":"CRAN release: 2023-09-14 Stop loading entire namespace suggested package available #296 Unexport objects: .import, .export, is_file_text; remove documentation arg_reconcile #321 Update Examples make realistic #327 Add support qs #275 h/t David Schoch Use arrow import / export feather #340 export_list can write multiple data frames single archive file (e.g. zip, tar) directory #346 h/t David Schoch get_info added #350 POTENTIALLY BREAKING: setclass parameter now authoritative. Therefore: import(\"starwars.csv\", data.table = TRUE, setclass = \"tibble\") return tibble (unlike previous versions data.table returned). default class data frame. can either explicitly use setclass parameter; set option: options(rio.import.class = \"data.table\"). h/t David Schoch #336 Parquet feather now formats supported box; Possible setclass arrow / arrow_table; ArrowTabular class can exported #315 Add “extension”, “labelled” vignettes Support readODS 2.1.0 features reading writing Flat ODS; export Multiple data frames #358 POTENTIALLY BREAKING: Use writexl instead openxlsx. Option read xlsx openxlsx (.e. import(\"starwars.xlsx\", readxl = FALSE)) always TRUE. ability overwrite existing sheet existing xlsx file also removed. design principle rio. POTENTIALLY BREAKING: following options deprecated: import(fread), import(readr = TRUE), import(haven), import(readxl) export(fwrite). import almost use data.table, haven, readxl, internal function (fwf) import export data. Currently, options stay backward compatibility removed v2.0.0. #343 h/t David Schoch POTENTIALLY BREAKING: ... handled differently. Underlying functions using “Tidy” convention (e.g. readxl::read_xlsx()) can use “Base Convention” (See new vignette: remap). Unused arguments passed underlying function ... silently ignored default. new option rio.ignoreunusedargs added control behavior. #326 … correctly passed exporting ODS feather #318 POTENTIALLY BREAKING: JSON exported UTF-8 default; solved encoding issues Windows R < 4.2. won’t affect modern R installation UTF-8 default. #318 POTENTIALLY BREAKING: YAML exported using yaml::write_yaml(). can’t pass UTF-8 check older systems. Disclaimer added. #318 check file argument #301 import_list works single Excel/HTML/Zip online #294 Correct XML/HTML escaping #303 Create directory doesn’t exist #347 remove obsolete data.table option #323 write documentation blocks markdown #311 remove @importFrom #325 h/t David Schoch rearrange “Package Philosophy” Vignette #320 Create single source truth import export functions #313 Clarify concepts: now format #351 David Schoch @schochastics","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0530","dir":"Changelog","previous_headings":"","what":"rio 0.5.30","title":"rio 0.5.30","text":"CRAN release: 2023-08-29 Maintenance release: new maintainer Mark .sas7bdat deprecated Change minimum R version 3.6","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0529","dir":"Changelog","previous_headings":"","what":"rio 0.5.29","title":"rio 0.5.29","text":"CRAN release: 2021-11-22 fixes CRAN","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0528","dir":"Changelog","previous_headings":"","what":"rio 0.5.28","title":"rio 0.5.28","text":"Various fixes tests, examples, documentation CRAN. Temporarily disabled tests failed Mac M1s.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0527","dir":"Changelog","previous_headings":"","what":"rio 0.5.27","title":"rio 0.5.27","text":"CRAN release: 2021-06-21 Documentation fixes CRAN.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0526","dir":"Changelog","previous_headings":"","what":"rio 0.5.26","title":"rio 0.5.26","text":"CRAN release: 2021-03-01 Added support “zsav” format. (#273)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0525","dir":"Changelog","previous_headings":"","what":"rio 0.5.25","title":"rio 0.5.25","text":"Modified tests per email request CRAN. Added coerce_character argument (default FALSE) factorize() enable coercing character columns factor. (#278)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0524","dir":"Changelog","previous_headings":"","what":"rio 0.5.24","title":"rio 0.5.24","text":"Fix handling “label” “labels” attributes exporting using haven methods (SPSS, Stata, SAS). (#268, h/t Ruben Arslan) Fix (different bug?) handling factors haven::labelled() (#271, Alex Bokov) HTML import can now handle multiple tbody elements within single table, th element non-header row, empty elements either header data. (#260, #263, #264 Bill Denney)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0523","dir":"Changelog","previous_headings":"","what":"rio 0.5.23","title":"rio 0.5.23","text":"CSVY support now provided data.table::fread() data.table::fwrite(), providing significant performance gains. Added internal arg_reconcile() function streamline task removing/renaming arguments compatibility various functions (#245, Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0522","dir":"Changelog","previous_headings":"","what":"rio 0.5.22","title":"rio 0.5.22","text":"Added export_list() function write list data frames multiple files using vector file names file pattern. (#207, h/t Bill Denney) Added is_file_text() function determine whether file plain-text format. Optionally narrower subsets characters can specified, e.g. ASCII. (#236 Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0521","dir":"Changelog","previous_headings":"","what":"rio 0.5.21","title":"rio 0.5.21","text":"Added support Apache Arrow (Parquet) files. (#214) Fix dropping variable label characterize() factorize(). (#204, h/t David Armstrong) import_list() now returns filename attribute data frame list (importing multiple files), order distinguish files base name different extensions (e.g., import_list(c(\"foo.csv\", \"foo.tsv\"))). (#208, h/t Vimal Rawat) Import DBF files now convert strings factors. (#202, h/t @jllipatz) Implemented import() method .dump R files. (#240)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0520","dir":"Changelog","previous_headings":"","what":"rio 0.5.20","title":"rio 0.5.20","text":"Additional pointers added indicate load .doc, .docx, .pdf files (#210, h/t Bill Denney) Ensure tests run corresponding package installed. (h/t Bill Denney) Escape ampersands html xml export (#234 Alex Bokov)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0519","dir":"Changelog","previous_headings":"","what":"rio 0.5.19","title":"rio 0.5.19","text":"Fix behavior export() plain text files append = TRUE (#201, h/t Julián Urbano) import_list() now preserve names Excel sheets, etc. ‘’ argument specified. (#162, h/t Danny Parsons) Modify message errors working unrecognized file formats. (#195, h/t Trevor Davis) Add support GraphPad Prism .pzfx files (#205, h/t Bill Denney)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0518","dir":"Changelog","previous_headings":"","what":"rio 0.5.18","title":"rio 0.5.18","text":"Adjust import()/export() JSON file formats allow non-data frame objects. Behavior modeled RDS format. (#199 h/t Nathan Day)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0517","dir":"Changelog","previous_headings":"","what":"rio 0.5.17","title":"rio 0.5.17","text":"Fix condition length > 1 first element used warning gather_attributes(). (#196, h/t Ruben Arslan)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0516","dir":"Changelog","previous_headings":"","what":"rio 0.5.16","title":"rio 0.5.16","text":"CRAN release: 2018-11-26 Fix condition length > 1 first element used warning standardize_attributes().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0515","dir":"Changelog","previous_headings":"","what":"rio 0.5.15","title":"rio 0.5.15","text":"CRAN release: 2018-11-25 Modified code produce compatibility haven 2.0.0 release. (#188) Add additional function suggestions ledger package. (#190, h/t Trevor Davis)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0514","dir":"Changelog","previous_headings":"","what":"rio 0.5.14","title":"rio 0.5.14","text":"Changes gather_attrs() haven 2.0.0 release. (#188) Fixed bug generated superfluous warning import(). style guide changes code.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0513","dir":"Changelog","previous_headings":"","what":"rio 0.5.13","title":"rio 0.5.13","text":"Allow import() objects data frames R-serialized (.rds .rdata) files. Also, export objects .rds files supported, previously intended. (#183, h/t Nicholas Jhirad) Added (suggests) support import EViews files using hexView::readEViews(). (#163, h/t Boris Demeshev) # rio 0.5.12 Add better package specification install_formats() reads Suggests field DESCRIPTION file. Edit header README.Rmd (thusly README.md) stop complaining lack title field. Fix typo CONTRIBUTING.md (line said “three arguments”, listed two).","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0511","dir":"Changelog","previous_headings":"","what":"rio 0.5.11","title":"rio 0.5.11","text":"Fixed bug import() wherein matlab files ignored unless format specified, well related bug made importing appear fail matlab files. (#171) Fixed bug export() wherein format ignored. (#99, h/t Sebastian Sauer) Fixed bug importing European-style semicolon-separated CSV files. Added test ensure correct behavior. (#159, h/t Kenneth Rose) Updated documentation reflect recent changes xlsx export() method. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0510","dir":"Changelog","previous_headings":"","what":"rio 0.5.10","title":"rio 0.5.10","text":"CRAN release: 2018-03-29 Removed csvy-related tests, failing CRAN.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-059","dir":"Changelog","previous_headings":"","what":"rio 0.5.9","title":"rio 0.5.9","text":"CRAN release: 2018-02-01 Removed longstanding warnings tests export() fixed-width format.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-058","dir":"Changelog","previous_headings":"","what":"rio 0.5.8","title":"rio 0.5.8","text":"Export get_ext() function. (#169) Fix bug related xml2 bug (#168, h/t Jim Hester) import_list() gains improved file name handling. (#164, h/t Ruaridh Williamson) Removed overwrite argument export() method xlsx files. Instead, existing workbooks always overwritten unless specified, case specified sheet (exists) overwritten. file exists sheet , data added new sheet existing workbook. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-057","dir":"Changelog","previous_headings":"","what":"rio 0.5.7","title":"rio 0.5.7","text":"Import files ambiguous .dat extension, typically text-delimited files, now passed data.table::fread() message. Export format remains unsupported. (#98, #155) Added support export SAS XPORT format (via haven::write_xpt()). (#157) Switched default import package SAS XPORT format haven::read_xpt() haven = FALSE toggle restoring previous default behavior using foreign::read.xpt(). (#157)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-056","dir":"Changelog","previous_headings":"","what":"rio 0.5.6","title":"rio 0.5.6","text":"Fixed bug import() compressed files wherein argument necessarily return correct file >=2 files compressed folder. Tweak handling export() xlsx workbooks specified. (#156)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-055","dir":"Changelog","previous_headings":"","what":"rio 0.5.5","title":"rio 0.5.5","text":"CRAN release: 2017-06-18 Expanded test suite increased test coverage, fixing tests failing certain CRAN builds.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-054","dir":"Changelog","previous_headings":"","what":"rio 0.5.4","title":"rio 0.5.4","text":"New functions characterize() factorize() provide methods converting “labelled” variables (e.g., Stata SPSS) character factor variables using embedded metadata. can also useful exporting metadata-rich file format plain text file. (#153)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-053","dir":"Changelog","previous_headings":"","what":"rio 0.5.3","title":"rio 0.5.3","text":"Fixed bug writing .zip .tar archives related absolute file paths. Fixed small bugs import_list() added tests behavior. Add .bib known-unsupported format via bib2df::bib2df(). Expanded test coverage.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-053-1","dir":"Changelog","previous_headings":"","what":"rio 0.5.3","title":"rio 0.5.3","text":"Fixed bug .import.rio_xlsx() readxl = FALSE. (#152, h/t Danny Parsons) Added new function spread_attrs() reverses gather_attrs() operation. Expanded test coverage.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-051","dir":"Changelog","previous_headings":"","what":"rio 0.5.1","title":"rio 0.5.1","text":"export() now sets variables “labels” attribute haven’s “labelled” class.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-050","dir":"Changelog","previous_headings":"","what":"rio 0.5.0","title":"rio 0.5.0","text":"CRAN release: 2017-04-28 CRAN Release. Restored import openxlsx writing xlsx supported install. (#150)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0428","dir":"Changelog","previous_headings":"","what":"rio 0.4.28","title":"rio 0.4.28","text":"Improved documentation mapping file format support packages used format. (#151, h/t Patrick Kennedy) import_list() now returns NULL entry failed imports, warning. (#149) import_list() gains additional arguments rbind_fill rbind_label control rbind-ing behavior. (#149)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0427","dir":"Changelog","previous_headings":"","what":"rio 0.4.27","title":"rio 0.4.27","text":"Import export clipboard now relies clipr::read_clip() clipr::write_clip(), respectively, thus (finally) providing Linux support. (#105, h/t Matthew Lincoln) Added rbind argument import_list(). (#149) Added setclass argument import_list(), ala import(). Switched requireNamespace() calls quietly = TRUE.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0426","dir":"Changelog","previous_headings":"","what":"rio 0.4.26","title":"rio 0.4.26","text":"fixes .csv.gz import/export. (#146, h/t Trevor Davis)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0425","dir":"Changelog","previous_headings":"","what":"rio 0.4.25","title":"rio 0.4.25","text":"Remove unecessary urltools dependency. New function import_list() returns list data frames multi-object Excel Workbook, .Rdata file, zip directory, HTML file. (#126, #129) export() can now write list data frames Excel (.xlsx) workbook. (#142, h/t Jeremy Johnson) export() can now write list data frames HTML (.html) file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0424","dir":"Changelog","previous_headings":"","what":"rio 0.4.24","title":"rio 0.4.24","text":"Verbosity export(format = \"fwf\") now depends options(\"verbose\"). Fixed various errors, warnings, messages fixed-width format tests. Modified defaults argument handling internal function read_delim(). Fixed handling “data.table”, “tibble”, “data.frame” classes set_class(). (#144)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0423","dir":"Changelog","previous_headings":"","what":"rio 0.4.23","title":"rio 0.4.23","text":"Moved non-critical format packages Suggests, rather Imports. (#143) Added support Matlab formats. (#78, #98) Added support fst format. (#138)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0422","dir":"Changelog","previous_headings":"","what":"rio 0.4.22","title":"rio 0.4.22","text":"Rearranged README. Bumped readxl dependency >= 0.1.1 (#130, h/t Yongfa Chen) Pass explicit excel_format arguments using readxl functions. (#130) Google Spreadsheets can now imported using allowed formats (CSV, TSV, XLSX, ODS). Added support writing ODS files via readODS::write_ods(). (#96)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0421","dir":"Changelog","previous_headings":"","what":"rio 0.4.21","title":"rio 0.4.21","text":"Handle HTML tables elements. (h/t Mohamed Elgoussi)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0420","dir":"Changelog","previous_headings":"","what":"rio 0.4.20","title":"rio 0.4.20","text":"Fixed big .import.rio_xls() .import.rio_xlsx() sheet argument return error.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0419","dir":"Changelog","previous_headings":"","what":"rio 0.4.19","title":"rio 0.4.19","text":"Fixed bug import delimited files fread = FALSE. (#133, h/t Christopher Gandrud)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0418","dir":"Changelog","previous_headings":"","what":"rio 0.4.18","title":"rio 0.4.18","text":"new data.table release, export using fwrite() now default text-based file formats.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0417","dir":"Changelog","previous_headings":"","what":"rio 0.4.17","title":"rio 0.4.17","text":"Fixed bug .import.rio_xls() wherein argument ignored. (h/t Mohamed Elgoussi)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0416","dir":"Changelog","previous_headings":"","what":"rio 0.4.16","title":"rio 0.4.16","text":"CRAN release: 2016-09-25 Added support importing multi-table HTML files using argument. (#126)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0415","dir":"Changelog","previous_headings":"","what":"rio 0.4.15","title":"rio 0.4.15","text":"Improved behavior import() export() respect unrecognized file types. (#124, #125, h/t Jason Becker) Added explicit tests S3 extension mechanism .import() .export(). Attempt recognize compressed non-archived file formats (e.g., “.csv.gz”). (#123, h/t trevorld)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0414","dir":"Changelog","previous_headings":"","what":"rio 0.4.14","title":"rio 0.4.14","text":"Update import export methods use new xml2 XML HTML export. (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0413","dir":"Changelog","previous_headings":"","what":"rio 0.4.13","title":"rio 0.4.13","text":"Fix failing tests related stricter variable name handling Stata files development version haven. (#113, h/t Hadley Wickham) Added support export .sas7bdat files via haven (#116) Restored support import SPSS portable via haven (#116) Updated import methods reflect changed formal argument names haven. (#116) Converted roxygen2 documentation made NEWS explicit markdown file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0412","dir":"Changelog","previous_headings":"","what":"rio 0.4.12","title":"rio 0.4.12","text":"CRAN release: 2016-08-10 rio sets options(datatable.fread.dec.experiment=FALSE) onLoad address Unix-specific locale issue.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0411","dir":"Changelog","previous_headings":"","what":"rio 0.4.11","title":"rio 0.4.11","text":"CRAN release: 2016-08-09 Note unsupported NumPy /o via RcppCNPy. (#112) Fix import European-style CSV files (sep = “,” sep2 = “;”). (#106, #107, h/t Stani Stadlmann)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0410","dir":"Changelog","previous_headings":"","what":"rio 0.4.10","title":"rio 0.4.10","text":"Changed feather Imports Suggests make rio installable older R versions. (#104) Noted new RStudio add-, GREA, uses rio. (#109) Migrated CSVY-related code separate package (https://github.com/leeper/csvy/). (#111)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-049","dir":"Changelog","previous_headings":"","what":"rio 0.4.9","title":"rio 0.4.9","text":"Removed unnecessary error xlsx imports. (#103, h/t Kevin Wright)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-048","dir":"Changelog","previous_headings":"","what":"rio 0.4.8","title":"rio 0.4.8","text":"CRAN release: 2016-06-14 Fixed bug handling “labelled” class variables imported haven. (#102, h/t Pierre LaFortune)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-047","dir":"Changelog","previous_headings":"","what":"rio 0.4.7","title":"rio 0.4.7","text":"Improved use sep argument import delimited files. (#99, h/t Danny Parsons) Removed support import SPSS Portable (.por) files, given deprecation haven. (#100)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-045","dir":"Changelog","previous_headings":"","what":"rio 0.4.5","title":"rio 0.4.5","text":"CRAN release: 2016-05-20 Fixed tests remove (unimportant) warnings. Fixed failing test file compression found v0.4.3 platforms.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-043","dir":"Changelog","previous_headings":"","what":"rio 0.4.3","title":"rio 0.4.3","text":"CRAN release: 2016-05-19 Improved, generalized, tested, expanded documentation argument import(). Expanded test suite made small fixes.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-042","dir":"Changelog","previous_headings":"","what":"rio 0.4.2","title":"rio 0.4.2","text":"Added support import export feather data serialization format. (#88, h/t Jason Becker)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-041","dir":"Changelog","previous_headings":"","what":"rio 0.4.1","title":"rio 0.4.1","text":"Fixed behavior gather_attrs() data.frame attributes gather. (#94) Removed unrecognized file format error import compressed files. (#93)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-040","dir":"Changelog","previous_headings":"","what":"rio 0.4.0","title":"rio 0.4.0","text":"CRAN release: 2016-05-01 CRAN Release.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0319","dir":"Changelog","previous_headings":"","what":"rio 0.3.19","title":"rio 0.3.19","text":"Added gather_attrs() function moves variable-level attributes data.frame level. (#80) Added preliminary support import HTML tables (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0318","dir":"Changelog","previous_headings":"","what":"rio 0.3.18","title":"rio 0.3.18","text":"Added support export HTML tables. (#86)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0317","dir":"Changelog","previous_headings":"","what":"rio 0.3.17","title":"rio 0.3.17","text":"Fixed bug import remote URLs incorrect file extensions.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0316","dir":"Changelog","previous_headings":"","what":"rio 0.3.16","title":"rio 0.3.16","text":"Added support import fixed-width format files via readr::read_fwf() specified widths argument. may enable faster import types files provides base-like interface working readr. (#48)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0315","dir":"Changelog","previous_headings":"","what":"rio 0.3.15","title":"rio 0.3.15","text":"Added support import export yaml. (#83) Fixed bug reading uncommented CSVY yaml header contained single-line comments. (#84, h/t Tom Aldenberg)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0314","dir":"Changelog","previous_headings":"","what":"rio 0.3.14","title":"rio 0.3.14","text":"Diagnostic messages cleaned facilitate translation. (#57)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0312","dir":"Changelog","previous_headings":"","what":"rio 0.3.12","title":"rio 0.3.12","text":".import() .export() now exported S3 generics documentation added describe write rio extensions new file types. example functionality shown new suggested “rio.db” package.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0311","dir":"Changelog","previous_headings":"","what":"rio 0.3.11","title":"rio 0.3.11","text":"import() now uses xml2 read XML structures export() uses custom method writing XML, thereby negating dependency XML package. (#67) Enhancements made import export CSVY store attribute metadata variable-level attributes (like imports binary file formats). import() gains argument used select file return within compressed tar zip archive. Export tar now tries correct bugs tar() fixed base R via PR#16716.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0310","dir":"Changelog","previous_headings":"","what":"rio 0.3.10","title":"rio 0.3.10","text":"Fixed bug import() (introduced #62, 7a7480e5) prevented import clipboard. (h/t Kevin Wright) export() returns character string. (#82)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-039","dir":"Changelog","previous_headings":"","what":"rio 0.3.9","title":"rio 0.3.9","text":"use import() SAS, Stata, SPSS files streamlined. Regardless whether haven = TRUE argument used, data.frame returned import() now (nearly) identical, attributes stored variable rather data.frame level. non-backwards compatible change. (#80)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-038","dir":"Changelog","previous_headings":"","what":"rio 0.3.8","title":"rio 0.3.8","text":"Fixed error export CSVY commented yaml header. (#81, h/t Andrew MacDonald)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-037","dir":"Changelog","previous_headings":"","what":"rio 0.3.7","title":"rio 0.3.7","text":"export() now allows automatic file compression tar, gzip, zip using file argument (e.g., export(iris, \"iris.csv.zip\")).","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-036","dir":"Changelog","previous_headings":"","what":"rio 0.3.6","title":"rio 0.3.6","text":"Expanded verbosity export() fixed-width format files added commented header containing column class width information. Exporting factors fixed-width format now saves values integer rather numeric. Expanded test suite separated tests format-specific files. (#51)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-035","dir":"Changelog","previous_headings":"","what":"rio 0.3.5","title":"rio 0.3.5","text":"Export CSVY files now includes commenting yaml header default. Import CSVY accommodates automatically. (#74)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-033","dir":"Changelog","previous_headings":"","what":"rio 0.3.3","title":"rio 0.3.3","text":"Export CSVY files metadata now supported export(). (#73) Import CSVY files now stores dataset-level metadata attributes output data.frame. (#73, h/t Tom Aldenberg) rio receives unrecognized file format, now issues message. new internal .import.default() .export.default() produce error. enables add-packages support additional formats new s3 methods form .import.rio_EXTENSION() .export.rio_EXTENSION().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-032","dir":"Changelog","previous_headings":"","what":"rio 0.3.2","title":"rio 0.3.2","text":"Use S3 dispatch internally call new (unexported) .import() .export() methods. (#42, h/t Jason Becker)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-030","dir":"Changelog","previous_headings":"","what":"rio 0.3.0","title":"rio 0.3.0","text":"CRAN release: 2016-01-14 Release CRAN. Set default numerical precision (2 decimal places) export fixed-width format.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0213","dir":"Changelog","previous_headings":"","what":"rio 0.2.13","title":"rio 0.2.13","text":"Import stats package na.omit().","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-0211","dir":"Changelog","previous_headings":"","what":"rio 0.2.11","title":"rio 0.2.11","text":"Added support direct import Google Sheets. (#60, #63, h/t Chung-hong Chan)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-027","dir":"Changelog","previous_headings":"","what":"rio 0.2.7","title":"rio 0.2.7","text":"Refactored remote file retrieval separate (non-exported) function used import(). (#62) Added test sutie test file conversion. Expanded test suite include test export formats.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-026","dir":"Changelog","previous_headings":"","what":"rio 0.2.6","title":"rio 0.2.6","text":"Cleaned NAMESPACE file.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-025","dir":"Changelog","previous_headings":"","what":"rio 0.2.5","title":"rio 0.2.5","text":"file format remote file identified supplied URL final URL reported curl::curl_fetch_memory(), HTTP headers checked filename Content-Disposition header. (#36) Removed longurl dependency. longer needed can identify formats using curl’s url argument. Fixed bug related importing European-style (“csv2”) format files. (#44) Updated CSVY import embed variable-level metadata. (#52) Use urltools::url_parse() extract file extensions complex URLs (e.g., query arguments). (#56) Fixed NAMESPACE notes base packages. (#58)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-024","dir":"Changelog","previous_headings":"","what":"rio 0.2.4","title":"rio 0.2.4","text":"Modified behavior files imported using haven now store variable metadata data.frame level default (unlike default behavior haven, can cause problems). (#37, h/t Ista Zahn) Added support importing CSVY (http://csvy.org/) formatted files. (#52) Added import dependency data.table 1.9.5. (#39)","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-022","dir":"Changelog","previous_headings":"","what":"rio 0.2.2","title":"rio 0.2.2","text":"Uses longurl package expand shortened URLs file type can easily determined.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-021","dir":"Changelog","previous_headings":"","what":"rio 0.2.1","title":"rio 0.2.1","text":"Improved support importing compressed directories, especially web-based compressed directories. (#38) Add import dependency curl >= 0.6 facilitate content type parsing format inference URL redirects. (#36) Add bit64 Suggests remove import warning.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-02","dir":"Changelog","previous_headings":"","what":"rio 0.2","title":"rio 0.2","text":"CRAN release: 2015-05-07 import always returns data.frame, unless setclass specified. (#22) Added support import legacy Excel (.xls) files readxl::read_excel, making use optional. (#19) Added support import export system clipboard Windows Mac OS. Added support export simple XML documents. (#12) Added support import simple XML documents via XML::xmlToDataFrame. (#12) Added support import ODS spreadsheet formats. (#12, h/t Chung-hong Chan) Use data.table::fread default reading delimited files. (#3) Added support import export dput dget objects. (#10) Added support reading compressed archives (.zip .tar). (#7) Added support writing fixed-width format. (#8) Set stringsAsFactors = FALSE default reading tabular data. (#4) Added support HTTPS imports. (#1, h/t Christopher Gandrud) Added support automatic file naming export based object name file format. (#5) Exposed convert function. Added vignette, knitr-generated README.md, updated documentation. (#2) Added non-exported functions simplify argument passing streamline package API. (#6) Separated import, export, convert, utilities separate source code files. Expanded set supported file types/extensions, switched SPSS, SAS, Stata formats haven, making use optional.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-012","dir":"Changelog","previous_headings":"","what":"rio 0.1.2","title":"rio 0.1.2","text":"CRAN release: 2013-09-04 Updated documentation fixed bug csv import without header.","code":""},{"path":"http://gesistsa.github.io/rio/news/index.html","id":"rio-011","dir":"Changelog","previous_headings":"","what":"rio 0.1.1","title":"rio 0.1.1","text":"CRAN release: 2013-08-28 Initial release","code":""}]
Name
Archive files (handled by tar)tar / tar.gztar / tar.gz / tgz / tar.bz2 / tbz2 utils utils Default
Compressed CSVgzdata.tabledata.tableBzip2bz2 / bzip2basebase DefaultOnly csv.gz is supported
Gzipgz / gzipbasebaseDefault
Zip files zip utils
CSVY (CSV + YAML metadata header) csvy data.table
Comma-separated data csv data.table
Comma-separated data (European) csv2 data.table
Data Interchange Format dif utils
Epiinfo epiinfo / rec foreign
Excel excel / xlsx readxl
Excel (Legacy) xls readxl
Fixed-width format data fwf readr
Fortran data fortran utilsNo recognized extension
Google Sheets googlesheets data.tableAs comma-separated data
Minitab minitab / mtp foreign
Pipe-separated data psv data.table
R syntax r base
SAS sas / sas7bdat havenExport is deprecated
SAS XPORT xport / xpt haven
SPSS sav / spss haven
SPSS (compressed) zsav haven
SPSS Portable por haven
Saved R objects rda / rdata base
Serialized R objects rds base
Stata dta / stata haven
Systat syd / systat foreign
Tab-separated data / tsv / txt data.table
Text Representations of R Objects dump base
Weka Attribute-Relation File Format arff / weka foreign
XBASE database files dbf foreign
Apache Arrow (Parquet) parquet arrow
Clipboard clipboard cliprdefault is tsv
EViews eviews / wf1 hexView
Fast Storage fst fst
Feather R/Python interchange format feather arrow
Graphpad Prism pzfx pzfx
HTML Tables htm / html xml2
JSON json jsonlite
Matlab mat / matlab rmatio
OpenDocument Spreadsheet ods readODS
OpenDocument Spreadsheet (Flat) fods readODS
Serialized R objects (Quick) qs qs
Shallow XML documents xml xml2
YAML yaml / yml yaml