Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Tuesday, April 23, 2013

Category Colors in R

I thought I'd write down the color palette I use for categories. I've seen many discussions about gradient color choices, but category colors are less often discussed. I have a function given below which generates colors where there is not meant to be an ordering to the color. It is important when data points are near, that they are easy to distinguish with the eye. It makes more sense to see it:


Monday, April 22, 2013

ggplot Style in Classic R Plots

ggplot is a highly acclaimed R package for plotting. I have had very little experience with the library because I've mostly memorized all the quirks of normal R plots. I like the ggplot default style though, so I thought write down how to replicate it in R plots. The distinctive feature of ggplot is the gray rectangle and white grid lines. This may be replicated like so:



Here's an example

Thursday, April 11, 2013

Speeding up R

I've been programming in R for a while now. Whenever I've had performance problems, it almost always is due to data.frame usage. To check what's slowing down your R code, just use the Rprof command like so:

Tuesday, October 16, 2012

Update on Amino Acid Interactions

A few months ago I wrote a post about amino acid interactions. It showed how much the different amino acids like to be in contact with one another. Now, in celebration of my upcoming paper in Chemical Science, I've updated the figure for surface interactions. It is shown below.

Thursday, July 14, 2011

Predator-Prey Models and Global Warming Followup

I thought I'd follow up my last post with some information on some of the tools I used. I'm not going to talk about how I made the equations, because they came out terrible and I'm trying to come up with a new way. I guess if anyone is curious: I made them in LaTeX and used gimp to convert them to PNGs.

Ok, so let's see how I made the graphics. Here's the first graphic, in case anyone forgot.