ggplot2: I’m a convert
April 12, 2012 – 4:56 pmI have been using lattice
for my R graphics for years, and it is a great software package based on William Cleveland’s groundbreaking approach to analyzing data. However, a few weeks ago I was trying to show data points, means, and summary bars in the same graphic, a task that should be straightforward in a graphics environment. This is not impossible in lattice
, but does involve writing a cumbersome “panel function.” This approach was great for its time – when lattice
came out there was nothing else like it – but unfortunately it has not evolved into a more user-friendly system.
Having read about ggplot2
, I knew that it had a more modular system where you can add or subtract different graphical elements such as summary stats or data points at will. So, I tried it for the data I was working on and never looked back.
Here’s my first ggplot2
figure that drew me to switch:
It took minimal effort to learn the ggplot2
system. In addition to the useful modular design, the default approaches to tasks such as automatic legend creation, log axes, and jittering are well done.
While I know an upgrade when I see one, I will also miss lattice
since I think it’s a fantastic piece of open source software that was my analysis workhorse for the last eight years. It was also one of the packages that really motivated me to learn R.
Sorry, comments for this entry are closed at this time.