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 R-bloggers.com 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.