Posted on Categories Opinion, Programming, Tutorials2 Comments on Standard Evaluation Versus Non-Standard Evaluation in R

## Standard Evaluation Versus Non-Standard Evaluation in R

There is a lot of unnecessary worry over “Non Standard Evaluation” (NSE) in `R` versus “Standard Evaluation” (SE, or standard “variables names refer to values” evaluation). This very author is guilty of over-discussing the issue. But let’s give this yet another try.

The entire difference between NSE and regular evaluation can be summed up in the following simple table (which should be clear after we work some examples).

Posted on Categories Coding, Opinion, Pragmatic Data Science, Statistics, Tutorials

## R Tip: Think in Terms of Values

`R` tip: first organize your tasks in terms of data, values, and desired transformation of values, not initially in terms of concrete functions or code.

I know I write a lot about coding in `R`. But it is in the service of supporting statistics, analysis, predictive analytics, and data science.

`R` without data is like going to the theater to watch the curtain go up and down.

(Adapted from Ben Katchor’s Julius Knipl, Real Estate Photographer: Stories, Little, Brown, and Company, 1996, page 72, “Excursionist Drama 2”.)

Usually you come to `R` to work with data. If you think and plan in terms of data and values (including introducing more data to control processing) you will usually work in much faster, explainable, and maintainable fashion.

Posted on Categories Coding, data science, Opinion, Programming, Statistics, Tutorials13 Comments on Tutorial: Using seplyr to Program Over dplyr

## Tutorial: Using seplyr to Program Over dplyr

`seplyr` is an `R` package that makes it easy to program over `dplyr` `0.7.*`.

To illustrate this we will work an example.

Posted on Categories Coding, Programming, Statistics, Tutorials

## Introduction

The development version CRAN version of our `R` helper function `wrapr::let()` has switched from string-based substitution to abstract syntax tree based substitution (AST based substitution, or language based substitution).

I am looking for some feedback from `wrapr::let()` users already doing substantial work with `wrapr::let()`. If you are already using `wrapr::let()` please test if the current development version of `wrapr` works with your code. If you run into problems: I apologize, and please file a `GitHub` issue.

Posted on Categories Coding, data science, Opinion, Programming, Statistics, Tutorials10 Comments on Non-Standard Evaluation and Function Composition in R

## Non-Standard Evaluation and Function Composition in R

In this article we will discuss composing standard-evaluation interfaces (SE: parametric, referentially transparent, or “looks only at values”) and composing non-standard-evaluation interfaces (NSE) in `R`.

In `R` the package `tidyeval`/`rlang` is a tool for building domain specific languages intended to allow easier composition of NSE interfaces.

To use it you must know some of its structure and notation. Here are some details paraphrased from the major `tidyeval`/`rlang` client, the package dplyr: `vignette('programming', package = 'dplyr')`).

• "`:=`" is needed to make left-hand-side re-mapping possible (adding yet another "more than one assignment type operator running around" notation issue).
• "`!!`" substitution requires parenthesis to safely bind (so the notation is actually "`(!! )`", not "`!!`").
• Left-hand-sides of expressions are names or strings, while right-hand-sides are `quosures`/expressions.
Posted on Categories Coding, Opinion1 Comment on Another R [Non-]Standard Evaluation Idea

## Another R [Non-]Standard Evaluation Idea

Jonathan Carroll had a an interesting `R` language idea: to use `@`-notation to request value substitution in a non-standard evaluation environment (inspired by msyql User-Defined Variables).

He even picked the right image:

Posted on Categories Administrativia, Statistics5 Comments on My recent BARUG talk: Parametric Programming in R with replyr

## My recent BARUG talk: Parametric Programming in R with replyr

I want to share an edited screencast of my rehearsal for my recent San Francisco Bay Area R Users Group talk: