dplyr 0.7.0 with great improvements for programming

Dplyr 0.7.0 has been published. One of the greatest improvements is the enhancement for standard evaluation.

Let’s look at an example. Let’s say I want to apply a function to a column of a data.frame. But the name of the data.frame can change from call to call. So the actual column is the value of a string.

Earlier to dplyr 0.7.0 I used the following methods using lazyeval:

Using geom_ribbon() to visualize a corridor for your data

Let’s say you have some data like this 1 2 3 4 5 set.seed(42) data <- data.frame( x = seq(1,30), y = 0.3 * seq(1,30) + 2 * rnorm(30) ) So let’s plot it using ggplot: 1 2 library(ggplot2) ggplot(data, aes(x=x, y=y)) + geom_point() + geom_line() Plotting an aim-corridor If this is something like your revenue, pageviews or something like that you may ask: “Is this good or is this bad?

Subviews with knitr

Let’s say you have to do the same analysis with diffent data and you want to use knitr’s RMarkdown to publish the results of each analysis in one report. The Subview or Parameterized Report So you start writing a RMarkdown-file. You can define several variables this RMarkdown-files depends on. It’s called Parameterized Reports. As the above article describes you define these parameters in the header of the RMarkdown-file. So let’s try it: