Publications by learnr

ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 11)

13.08.2009

This is the 11th post in a series attempting to recreate the figures in Lattice: Multivariate Data Visualization with R (R code available here) with ggplot2. Previous parts in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10. Chapter 11 – Manipulating the “trellis” object Topics covered: Method...

1051 sym R (3378 sym/19 pcs) 34 img 19 tbl

ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 12)

18.08.2009

This is the 12th post in a series attempting to recreate the figures in Lattice: Multivariate Data Visualization with R (R code available here) with ggplot2. Previous parts in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11. Chapter 13 – Advanced Panel Functions Topics covered: Built-in p...

1164 sym R (11522 sym/46 pcs) 44 img 47 tbl

ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 13)

20.08.2009

This is the 13th post in a series attempting to recreate the figures in Lattice: Multivariate Data Visualization with R (R code available here) with ggplot2. Previous parts in this series: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6, Part 7, Part 8, Part 9, Part 10, Part 11, Part 12. Chapter 14 – New Trellis Displays Topics covered: Examp...

997 sym R (3744 sym/18 pcs) 30 img 18 tbl

ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Final Part)

25.08.2009

Over the past weeks I have tried to replicate the figures in Lattice: Multivariate Data Visualization with R using Hadley Wickham’s ggplot2. With the exception of a few graph types (e.g. ggplot2 doesn’t support 3d-graphs, and there were a few other cases), it was possible to create ggplot2 versions of almost all the figures. Sometimes this re...

5515 sym 12 img

brew: Creating Repetitive Reports

09.09.2009

United Nations report World Population Prospects: The 2008 Revision (highlights available here) provides data about the historical and forecasted population of the country. In exploring the future and past population trends it is relatively easy to subset the dataset by your selected variable. > file <- c("UNdata_Population.csv") > population <-...

3104 sym R (8690 sym/8 pcs) 12 img 8 tbl

ggplot2: Back-to-back Bar Charts

23.09.2009

On the ggplot2 mailing-list the following question was asked: How to create a back-to-back bar chart with ggplot2? For anyone who don’t know what I am talking about, have a look on a recent paper from the EU. I’d like to create plots like the graphs 5,6,18 in the paper. An example graph from the above report is below: Let’s create the sam...

2274 sym R (1575 sym/13 pcs) 28 img 13 tbl

WordPress Blogging with R in 3 Steps

29.09.2009

A few people have emailed me and enquired about the use of tools mentioned at the end of this post to make blogposts with embedded R-commands. Below is a small step-by-step walkthrough of how to accomplish this. Write your blog post in a simple text file, you can include formatting using asciidoc syntax. Let’s call the file workflow.Rnw: Lett...

1254 sym R (915 sym/6 pcs) 12 img 5 tbl

ggplot2: Two Color XY-Area Combo Chart

21.10.2009

[email protected] blog shows how to fill in the area between two crossing lines in an Excel chart. This post was also published as a guest-post on PTS blog. Let’s try to replicate this graph in ggplot2. First, load ggplot2 and generate the data frame to be used in the example (I am using a slightly modified dataset, therefore the final resul...

2249 sym R (1755 sym/13 pcs) 26 img 13 tbl

ggplot2: Overplotting In a Faceted Scatterplot

03.12.2009

Hadley Wickham recently shared a nice tip on how to get a faceted scatterplot plot with all points in the background of each plot. This technique makes a clever use of setting the faceting variable to NULL so that all points are plotted in light grey in all the facets. > library(ggplot2) > ggplot(mtcars, aes(cyl, mpg)) + geom_point(data = trans...

916 sym R (362 sym/3 pcs) 8 img 3 tbl

Data Profiling in R

17.12.2009

In 2006 UserR conference Jim Porzak gave a presentation on data profiling with R. He showed how to draw summary panels of the data using a combination of grid and base graphics. Unfortunately the code has not (yet) been released as a package, so when I recently needed to quickly review several datasets at the beginning of an analysis project I s...

2454 sym R (907 sym/10 pcs) 10 img 10 tbl