seplyr

Improved Standard Evaluation Interfaces for Common Data Manipulation Tasks

50
12
R

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.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = " # "
)
options(width =100)

The R package seplyr supplies improved standard evaluation interfaces for some common dplyr data plying tasks.

This project is used in production to avoid exposing all of the details of 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’/‘rqdatatable’.

To get started we suggest visiting the seplyr site, and checking out some examples.

One quick example:

# 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 with:

   install.packages('seplyr')

Please see help("%.>%", package="wrapr") for details on “dot pipe.”

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

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.