Blog Archives

ggplot2: Two Color XY-Area Combo Chart

October 21, 2009
By
ggplot2: Two Color XY-Area Combo Chart

David@Work 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

Read more »

WordPress Blogging with R in 3 Steps

September 29, 2009
By
WordPress Blogging with R in 3 Steps

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

Read more »

WordPress Blogging with R in 3 Steps

September 29, 2009
By
WordPress Blogging with R in 3 Steps

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 tex...

Read more »

ggplot2: Back-to-back Bar Charts

September 23, 2009
By
ggplot2: Back-to-back Bar Charts

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

Read more »

ggplot2: Back-to-back Bar Charts

September 23, 2009
By
ggplot2: Back-to-back Bar Charts

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 graph...

Read more »

brew: Creating Repetitive Reports

September 9, 2009
By
brew: Creating Repetitive Reports

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 <- read.csv(file) > names(population) <- c("code", "country", "year", +

Read more »

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

August 25, 2009
By
ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Final Part)

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

Read more »

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

August 20, 2009
By
ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 13)

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

Read more »

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

August 18, 2009
By
ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 12)

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

Read more »

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

August 13, 2009
By
ggplot2 Version of Figures in “Lattice: Multivariate Data Visualization with R” (Part 11)

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”

Read more »