Title: | Effortlessly Read Any Rectangular Data |
---|---|
Description: | Providing just one primary function, 'readit' uses a set of reasonable heuristics to apply the appropriate reader function to the given file path. As long as the data file has an extension, and the data is (or can be coerced to be) rectangular, readit() can probably read it. |
Authors: | Ryan Price [aut, cre] |
Maintainer: | Ryan Price <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-11-13 03:28:14 UTC |
Source: | https://github.com/ryapric/readit |
haven
ReadersThis function is a helper for readit()
to guess the type of file that can
be passed to an appropriate reader from haven.
guess_haven(.data)
guess_haven(.data)
.data |
Data to guess/read |
A reader function, and its label
Since a .txt
file is of ambiguous delimitation, this function is a helper
for readit()
to guess the type, and return the appropriate reader.
guess_txt(.data)
guess_txt(.data)
.data |
Data to guess/read |
A reader function, and its label
NOTE: the readit
package is retired, and this function throws deprecation
warnings when called. Please use the
rio::import() function instead.
readit(.data, ..., tidyverse = TRUE)
readit(.data, ..., tidyverse = TRUE)
.data |
File path to read data from. |
... |
Additional arguments passed to tidyverse read functions, e.g.
|
tidyverse |
Should |
Given a file path, read the data into R, regardless of file type/extension.
readit
is a thick wrapper around many of the
tidyverse libraries, but can be forced to use
base functions where possible. Note that the caveat is that the file
needs to have an extension, as well as be of a relatively common type.
"Common types" are any file type that can be handled by the
readr,
readxl, or
haven packages.
readit(system.file("examples", "csv.csv", package = "readit")) readit(system.file("examples", "tab_sep.txt", package = "readit")) readit(system.file("examples", "semi_sep.txt", package = "readit")) readit(system.file("examples", "xlsx.xlsx", package = "readit")) readit(system.file("examples", "xls.xls", package = "readit")) readit(system.file("examples", "iris.sas7bdat", package = "readit"))
readit(system.file("examples", "csv.csv", package = "readit")) readit(system.file("examples", "tab_sep.txt", package = "readit")) readit(system.file("examples", "semi_sep.txt", package = "readit")) readit(system.file("examples", "xlsx.xlsx", package = "readit")) readit(system.file("examples", "xls.xls", package = "readit")) readit(system.file("examples", "iris.sas7bdat", package = "readit"))