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:

Sending R Reports via email

Some days ago I found a post on about Scheduling R Markdown Reports via email. The original post can be found here. Unfortunately this article describes the sending of emails on Windows systems. So let me show you how I send R Reports on a Linux system. Report Generation First I need to generate the report. As I wrote last year I prefer to create pdf-reports using knitr and LaTeX.

Doing A/B-testing with Google Analytics and R, Part 2

Recently I described a way to do [A/B-testing with Google Analytics and R](/2015/08/20/doing-a-b-testing-with-google-analytics-and-r/. I wrote about tests with a two-way outcome: bounced or not bounced. But what do we do when the metric has more than two possible outcomes? Let’s say something like sessionDuration or pageLoadTime. Then Google just gives you an aggregated value like avgSessionDuration or avgPageLoadTime. You don’t get any information about the distribution of this metric. So you have to do it on your own!

Doing A/B-testing with Google Analytics and R

There are several ways for A/B-Testing with Google Analytics. First you can use the Google way. Google calls it [Content Experiments]( But you have to define a goal when you set up an experiment. If you want to investigate several metrics I thinks the better way is to do the analysis on your own. Use Google Analytics to create the data. But do the analysis on your own. But first I’d like to summarize what I’d like to do: