Named Colors in R

I spend too much time picking out colors for plots. R knows the names of 657 of them, but sometimes I don’t know if I’m in the mood for steelblue3 or steelblue4. I have this handy function in my .Rprofile file which takes a search string such as “blue” and returns a plot showing all colors with matching names.

plot.color.matches = function ( {

	matches = colors()[grep(, colors())]

	barplot(rep(1, length(matches)), col=matches, 
		pch=16, names=matches, las=2, cex.names=0.5, axes=FALSE)


You can call it with








to see all matching colors side by side.

R Named Colors - Blues


I’ve decided on “deepskyblue4″ for the current plot.

The Long Trip to the Cutting Edge

It’s the first week of class here, which always catches me off guard. Suddenly the streets are filled with people unfamiliar with the laws of walking around in New York City. I might be getting curmudgeonly.

This quote from an interview with Randall Munroe, creator of XKCD (previously), is apropos, as many little baby graduate students are starting their climbs up towards the shoulders of giants:

When you’re talking about pure research, every year it’s a longer trip to the cutting edge. Students have to spend a larger percentage of their careers catching up to the people who have gone before them. My solution to that is to tackle problems that are so weird that no one serious has ever spent any time on them.

Training Dwarf Lemurs for the Silver Screen

I was lucky to catch a preview screening of the upcoming IMAX movie, Island of Lemurs, a few weeks back. (See also True Facts about Morgan Freeman, the narrator.) Some dwarf lemurs (genus Cheirogaleus) played the role of the first primates to reach Madagascar. Check out this video of how the keepers at Duke Lemur Center got them ready for their debut: