Improved Standard Evaluation Interfaces for Common Data Manipulation Tasks

The 'seplyr' (standard evaluation plying) package supplies improved standard evaluation adapter methods for important common 'dplyr' data manipulation tasks. In addition the 'seplyr' package supplies several new "key operations bound together" methods. These include 'group_summarize()' (which combines grouping, arranging and calculation in an atomic unit), 'add_group_summaries()' (which joins grouped summaries into a 'data.frame' in a well documented manner), 'add_group_indices()' (which adds per-group identifiers to a 'data.frame' without depending on row-order), 'partition_mutate_qt()' (which optimizes mutate sequences), and 'if_else_device()' (which simulates per-row if-else blocks in expression sequences).


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

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

One quick example:

# supplied by a user, function argument, or control file.
orderTerms <- c('cyl', 'desc(gear)')
 
# load packages
library("seplyr")
 #  Loading required package: wrapr
 
# where we are actually working (perhaps in a re-usable
# script or function)
datasets::mtcars %.>% 
  arrange_se(., orderTerms) %.>% 
  head(.)
 #     mpg cyl  disp  hp drat    wt  qsec vs am gear carb
 #  1 26.0   4 120.3  91 4.43 2.140 16.70  0  1    5    2
 #  2 30.4   4  95.1 113 3.77 1.513 16.90  1  1    5    2
 #  3 22.8   4 108.0  93 3.85 2.320 18.61  1  1    4    1
 #  4 24.4   4 146.7  62 3.69 3.190 20.00  1  0    4    2
 #  5 22.8   4 140.8  95 3.92 3.150 22.90  1  0    4    2
 #  6 32.4   4  78.7  66 4.08 2.200 19.47  1  1    4    1

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')

or from GitHub:

   devtools::install_github('WinVector/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.

News

seplyr 0.5.3 2018-01-21

  • Fix misspelling of package import.

seplyr 0.5.2 2018-01-20

  • Fix missed case in statement partitioner.
  • Fix deprecations and visibility of stringAlgebra.
  • Start to relax quoting conditions.
  • Factor mutate helper.

seplyr 0.5.1 2018-01-02

  • mutate_se now uses partition_mutate_se.
  • partition on re-assignment (if_else_device does this, but includes a re-use so was okay).
  • Documentation improvements.
  • More argument checking.
  • Move to wrapr 1.0.2 (pick up qae() and qe()).
  • Deprecate _nse forms.

seplyr 0.5.0 2017-11-24

  • mutate statement planner.
  • per-row block if-else simulator

seplyr 0.1.6 2017-11-17

  • work on lists.
  • re-export more dplyr functions.
  • mutate_nse in stages.
  • rename_nse in stages.
  • rename_se direct pass-through option.

seplyr 0.1.5 2017-08-28

  • add wrapr dependency (for named map builder, and lambda abstraction).
  • finish string algebra and add more *_nse() methods.

seplyr 0.1.4 2017-08-21

  • Documentation fixes.
  • add mutate_nse().
  • add lambda operator.

seplyr 0.1.3 2017-07-29

  • Implicit paste() in some cases.
  • Replace rlang::parse_expr() with rlang::parse_quosure() to get explicit environment control.

seplyr 0.1.2 2017-07-27

  • Add novelName().
  • Move dplyr to imports.

seplyr 0.1.1 2017-07-22

  • Fix some documentation.
  • add add_in_group_indices().
  • add many more adapter fns.
  • add := operator.
  • more vignettes.

seplyr 0.1.0 2017-07-14

  • First CRAN submission.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("seplyr")

0.5.3 by John Mount, a month ago


https://github.com/WinVector/seplyr/, https://winvector.github.io/seplyr/


Report a bug at https://github.com/WinVector/seplyr/issues


Browse source code at https://github.com/cran/seplyr


Authors: John Mount [aut, cre], Win-Vector LLC [cph]


Documentation:   PDF Manual  


GPL-3 license


Imports dplyr, rlang, dbplyr, DBI, RSQLite

Depends on wrapr

Suggests knitr, rmarkdown, testthat


Imported by WVPlots.

Depended on by replyr.


See at CRAN