Blog Archives

hipsteR: re-educating people who learned R before it was cool

May 15, 2014
By
hipsteR: re-educating people who learned R before it was cool

This morning, I started a tutorial for folks whose knowledge of R is (like mine) stuck in 2001. Yesterday I started reading the Rcpp book, and on page 4 there’s an example using the R function replicate, which (a) I’d never heard before, and (b) is super useful. I mean, I often write code like

Read more »

Further points on crayon colors

May 9, 2014
By
Further points on crayon colors

I saw this great post on crayola crayon colors at the Learning R blog, reproducing a nice graph of the Crayola crayon colors over time. (Also see this even nicer version.) The Learning R post shows how to grab the crayon colors from the wikipedia page, “List of Crayola crayon colors,” directly in R. Here’s

Read more »

Two more points about crayon colors

May 8, 2014
By
Two more points about crayon colors

If you want to use crayon colors in R but you don’t want to rely on my R/broman package, you can just grab the code. Copy the relevant lines from the R/brocolors.R file: I spent a bit of time thinking about how best to sort the colors in a meaningful way, for the plot_crayons() function.

Read more »

Crayon colors in R

May 7, 2014
By
Crayon colors in R

Last night I was working on a talk on creating effective graphs. Mostly, I needed to update the colors, as there’d been some gaudy ones in its previous form (e.g., slide 22). I usually pick colors using the crayons in the Mac Color Picker. But that has just 40 crayons, and I wanted more choices.

Read more »

“[” with the apply() functions, revisited

April 29, 2014
By
“[” with the apply() functions, revisited

I’d mentioned in the fall that one could use "[" in the apply-type functions, like this: I just realized that you can use this with matrices, too. If you have a list of matrices, you can pull out rows and columns with this technique. As you can see, my data isn’t “tidy.”

Read more »

Googling errors

February 14, 2014
By
Googling errors

@roguelynn tweeted the other day: If attendees of this weekend’s intro to python workshop leave with one thing, it’ll be to Google your error messages first and foremost. I had just talked about the technique in my Tools for Reproducible Research course, and I had a few recent examples. Gtk-WARNING **: cannot open display: I

Read more »

knitr in a knutshell tutorial

February 6, 2014
By
knitr in a knutshell tutorial

I spent a lot of time this week writing a short tutorial on knitr: knitr in a knutshell. This is my third little tutorial. (The previous ones were a git/github guide and a minimal make tutorial.) I’m pleased with these tutorials. In learning new computing skills, it can be hard to get started. My goal

Read more »

“[” and “[[” with the apply() functions

August 20, 2013
By
“[” and “[[” with the apply() functions

Did you know you can use "

Read more »

Electronic lab notebook

August 20, 2013
By
Electronic lab notebook

I was interested to read C. Titus Brown‘s recent post, “Is version control an electronic lab notebook?” I think version control is really important, and I think all computational scientists should have something equivalent to a lab notebook. But I think of version control as serving needs orthogonal to those served by a lab notebook.

Read more »

Read the source code

August 6, 2013
By
Read the source code

The other day, there was a bit of a twitter conversation about qqline in R. It made me think: how exactly is the line produced by qqline chosen? I seemed to recall that the line was through the first and third quartiles. An advantage of R is that you can just type the name of

Read more »