Blog Archives

Happy Thanksgiving from is.R()!

November 22, 2012
By
Happy Thanksgiving from is.R()!

Today’s post is mostly to wish everyone a Happy Thanksgiving. We will be taking the rest of the week off, and will return on Monday. Below is some code to reproduce the adorable Turkey above; enjoy! https://gist.github.com/4122464

Read more »

Representing density in two dimensions

November 21, 2012
By
Representing density in two dimensions

I’ll be subbing today for Chris, as we continue to explore some ggplot2 basics. Today, imagine that you have data distributed in two dimensions, and that you would like to convey differences in point density over space. As with many things, this...

Read more »

Gathering RealClearPolitics Polling Trends with XML

November 19, 2012
By
Gathering RealClearPolitics Polling Trends with XML

Now that the election is over, you may want to use polling data in a model of the campaign. Simon Jackman has thoughtfully made his daily state-by-state predictions available for download, but a commonly-used dataset is the RealClearPolitics polling a...

Read more »

Hjust and Vjust

November 16, 2012
By
Hjust and Vjust

So, when you’re setting the position of text in ggplot, you may have to use the hjust and vjust commands. Depending on your demands, and if you don’t understand what they’re doing, they might seem hard to use. I found one script that...

Read more »

Textual Healing Part II

November 15, 2012
By
Textual Healing Part II

Yesterday’s post showed a number of quick coding options for changing text in a basic ggplot. Here’s another two tricks for fine-tuning faceted plots. Again, let’s load our made up data about tooth growth (a real dataset in R, ToothGr...

Read more »

Textual Healing

November 14, 2012
By
Textual Healing

While I know there are several awesome guides for how to make fine-tuning adjustments to plot labels/axes/ticks/text in ggplot, this is still the most common question I get from people new to ggplot: how do I change the size/font/color/position of (som...

Read more »

Can’t a plot catch a break(s)?

November 13, 2012
By
Can’t a plot catch a break(s)?

This post continues with the theme of how to modify plots from within ggplot; today we will specifically looking at custom axis breaks. Plots later in the week will examine the commands to change text in the plot area. The various other shortcomings o...

Read more »

Interactive color picker, using locator()

November 9, 2012
By
Interactive color picker, using locator()

I mostly wrote this just to see how locator() works, and ended up making an HCL color picker, so you can make your own visually offensive rainbow color palettes! Or, you can make your own nice color palettes. It is up to you. Essentially, this script...

Read more »

Five Thirty-Hate?

November 8, 2012
By
Five Thirty-Hate?

The last few days have been trying, mostly because folks keep asking me the same questions: have you voted? Who do you think will win the election? Do you think Nate Silver (http://fivethirtyeight.blogs.nytimes.com/)  is right? How confident are you ...

Read more »

Make your own electoral map

November 7, 2012
By
Make your own electoral map

You’ve already seen everyone else’s electoral map (see this amazing array of maps from 2008), how would you like to make your own? Today’s Gist allows you to do just that — input (manually!) state-by-state results, and output a...

Read more »