Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/WinVector/seplyr

Improved Standard Evaluation Interfaces for Common Data Manipulation Tasks
https://github.com/WinVector/seplyr

Last synced: 3 months ago
JSON representation

Improved Standard Evaluation Interfaces for Common Data Manipulation Tasks

Awesome Lists containing this project

README

        

---
output: github_document
---

This project has been removed from CRAN by the request of the author. The functions it supplied are now better supplied by rquery and rqdatatable.

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = " # "
)
options(width =100)
```

The [`R`](https://www.r-project.org) package [`seplyr`](https://github.com/WinVector/seplyr) supplies improved *s*tandard *e*valuation interfaces for some common `dplyr` data plying tasks.

This project is used in production to avoid exposing all of the details of [`rlang`](https://CRAN.R-project.org/package=rlang) at the user level, and a demonstration of what can be done through value-oriented programming. Alternately one could use another value-oriented data manipulation system ['rquery']( https://CRAN.R-project.org/package=rquery)/['rqdatatable'](https://CRAN.R-project.org/package=rqdatatable).

![](https://github.com/WinVector/seplyr/raw/master/tools/safety.png)

To get started we suggest visiting the [`seplyr` site](https://winvector.github.io/seplyr/), and checking out [some examples](https://winvector.github.io/seplyr/articles/seplyr.html).

One quick example:

```{r ex1c2}
# Assume this is set elsewhere,
# supplied by a user, function argument, or control file.
orderTerms <- c('cyl', 'desc(gear)')

# load packages
library("seplyr")

# where we are actually working (perhaps in a re-usable
# script or function)
datasets::mtcars %.>%
arrange_se(., orderTerms) %.>%
head(.)
```

The concept is: in writing re-usable code or scripts you pretend you do not know the actual column names you will be asked to work with (that these will be supplied as values later at analysis time). This forces you to write scripts that can be used even if data changes, and are re-usable on new data you did not know about when writing the script.

To install this package please either install from [CRAN](https://CRAN.R-project.org/package=seplyr) with:

```{r, eval=FALSE}
install.packages('seplyr')
```

Please see [`help("%.>%", package="wrapr")`](https://winvector.github.io/wrapr/reference/dot_arrow.html) for details on "dot pipe."

In addition to standard interface adapters `seplyr` supplies some non-trivial
statement transforms:

* [`partition_mutate_se()`](https://winvector.github.io/seplyr/reference/partition_mutate_se.html): [vignette](https://winvector.github.io/seplyr/articles/MutatePartitioner.html), and [article](https://winvector.github.io/FluidData/partition_mutate.html).
* [`if_else_device()`](https://winvector.github.io/seplyr/reference/if_else_device.html): [article](https://winvector.github.io/FluidData/partition_mutate_ex2.html).

## Note

Note: `seplyr` is meant only for "tame names", that is: variables and column names that are also valid *simple* (without quotes) `R` variables names.