Posts Tagged ‘ ggplot2 ’

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 »

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 »

Plotting letters as shapes in ggplot2

November 5, 2012
By
Plotting letters as shapes in ggplot2

This post is a little more esoteric than most, but I found myself needing to solve this problem, so I’m just passing the solution on to you. The plot above shows the distribution of DW-NOMINATE scores for the 18th Congress, with party indicated ...

Read more »

GGtutorial: Day 5 – Gradient Colors and Brewer Palettes

November 2, 2012
By
GGtutorial: Day 5 – Gradient Colors and Brewer Palettes

So, continuing with the short tutorials on how to do relatively simple (but sometimes very frustrating things) in ggplot, today’s post looks at how to use gradient colors and Brewer colors to color either continuous or discrete dependent variab...

Read more »

GGtutorial: Day 4 – More Colors

November 1, 2012
By
GGtutorial: Day 4 – More Colors

So far we’ve covered Melting and Casting data using the reshape() package and today we’re going to look at different ways of coloring and selecting palettes for plots. For these plots, we’re going to use the built in diamonds data...

Read more »

Montreal R User Group meetup Nov. 14th

October 29, 2012
By
Montreal R User Group meetup Nov. 14th

After a bit of a summer lull, the Montreal R User Group is meeting up again! We’re trying out a new venue this time. Notman House is the home of the web in Montreal. They hold hackathons and other tech user group meetups, and they are all around great people in an all around great

Read more »

Congressional ideology by state

October 25, 2012
By
Congressional ideology by state

In a recent post, I illustrated how to add a background geom to your ggplot. While that code worked, and the plot looked fine, it was pointed out to me that I was missing an important aspect of plot layering with ggplot2. Namely, it is not, as I previ...

Read more »

Plotting the debate "Winner"

October 24, 2012
By
Plotting the debate "Winner"

As a Political Scientist, it could not be more gauche to talk about the Presidential debate in terms of a winner and a loser, but the occasion provides the opportunity to show how to do (at least) three really useful things: Directly load price and v...

Read more »