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. |
Version: | 1.0.0 |
Date: | 2018-03-01 |
License: | MIT + file LICENSE |
Depends: | R (≥ 3.4.0) |
Imports: | crayon (≥ 1.3.4), haven (≥ 1.1.1), jsonlite (≥ 1.5), readr (≥ 1.1.1), readxl (≥ 1.0.0), tools (≥ 3.4.3) |
Suggests: | devtools (≥ 1.13.4), dplyr (≥ 0.7.4), knitr (≥ 1.19), rmarkdown (≥ 1.8), testthat (≥ 2.0.0) |
URL: | https://github.com/ryapric/readit |
BugReports: | https://github.com/ryapric/readit/issues |
RoxygenNote: | 6.0.1 |
Encoding: | UTF-8 |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2018-03-12 00:14:30 UTC; Ryan Price |
Author: | Ryan Price [aut, cre] |
Maintainer: | Ryan Price <ryapric@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2018-03-13 15:57:40 UTC |
Guess File Type to Pass to haven
Readers
Description
This function is a helper for readit()
to guess the type of file that can
be passed to an appropriate reader from haven.
Usage
guess_haven(.data)
Arguments
.data |
Data to guess/read |
Value
A reader function, and its label
Guess ".txt" Delimiter
Description
Since a .txt
file is of ambiguous delimitation, this function is a helper
for readit()
to guess the type, and return the appropriate reader.
Usage
guess_txt(.data)
Arguments
.data |
Data to guess/read |
Value
A reader function, and its label
Read Files of Any Type
Description
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.
Usage
readit(.data, ..., tidyverse = TRUE)
Arguments
.data |
File path to read data from. |
... |
Additional arguments passed to tidyverse read functions, e.g.
|
tidyverse |
Should |
Examples
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"))