knitr::opts_chunk$set( collapse = TRUE, message = FALSE, warning = FALSE, comment = '#>', fig.path = 'man/README/README-' )
This package contains functions that I use often in projects.
remotes::install_github('tonyelhabr/teproj')
.
Here is a list of all functions in the package.
library(teproj) ls('package:teproj')
The original purpose of this package was to provide a convenient interface
to the {readr}
and {rio}
functions for importing and exporting data to various file formats.
Because I often found myself using the variable name as the name of the file,
I figured it would be nice to implement 'lazy' methods for doing so.
Under the hood, this packages's functions use 'Non-Standared Evaluation' (NSE)
(using techniques that may or may
not be up to date with the latest {tidyverse}
methods of NSE r emo::ji('smile')
).
Additionally, while implementing these import
/export
functions,
I realized a couple of other functions that I often
use in projects could be added.
(I don't necessarily recommend using these 'other' functions, however, because they
are tailored towards my use cases.)
covrg <- covr::package_coverage() print(covrg)
import_ext*()
functions - Implement {rio}
-like interface (note the use
of the verb 'import') for reading data from files.
The main function is import_ext()
, which requires that the file extension be specified with
the ext
paramater. Shorcuts for the extensions that I find myself using most often
are implemented via the syntax import_ext_[ext]()
(e.g. import_ext_csv()
).
Under the hood, preference is given to {readr}
methods if they exist and can be recognized.
(This is because it reads in data.frame
s as tibble
s by default.
Otherwise, an attempt is made to use a {rio}
method (with subsequent coercion to a tibble
).
export_ext*()
functions - Counterpart to the import_ext_*()
functions.
Notably, exporting of plots is supported. However, the support is not robust--
it is intended only for use with ggplot2
plots, and only to the png
file format.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.