Posted on Categories Opinion, Programming, Tutorials3 Comments on Make Teaching R Quasi-Quotation Easier

## Make Teaching R Quasi-Quotation Easier

To make teaching `R` quasi-quotation easier it would be nice if `R` string-interpolation and quasi-quotation both used the same notation. They are related concepts. So some commonality of notation would actually be clarifying, and help teach the concepts. We will define both of the above terms, and demonstrate the relation between the two concepts.

Posted on Categories Programming, TutorialsTags , , , 1 Comment on Quoting in R

## Quoting in R

Many `R` users appear to be big fans of "code capturing" or "non standard evaluation" (NSE) interfaces. In this note we will discuss quoting and non-quoting interfaces in `R`.

Posted on Categories Coding, OpinionTags , , 2 Comments on Quasiquotation in R via bquote()

## Quasiquotation in R via bquote()

In August of 2003 Thomas Lumley added `bquote()` to `R` 1.8.1. This gave `R` and `R` users an explicit Lisp-style quasiquotation capability. `bquote()` and quasiquotation are actually quite powerful. Professor Thomas Lumley should get, and should continue to receive, a lot of credit and thanks for introducing the concept into `R`.

In fact `bquote()` is already powerful enough to build a version of `dplyr 0.5.0` with quasiquotation semantics quite close (from a user perspective) to what is now claimed in `tidyeval`/`rlang`.

Let’s take a look at that.

Posted on Categories Programming, TutorialsTags , , , , 4 Comments on R Tip: How to Pass a formula to lm

## R Tip: How to Pass a formula to lm

`R` tip : how to pass a `formula` to `lm()`.

Often when modeling in `R` one wants to build up a formula outside of the modeling call. This allows the set of columns being used to be passed around as a vector of strings, and treated as data. Being able to treat controls (such as the set of variables to use) as manipulable values allows for very powerful automated modeling methods.