Posts Tagged ‘ code ’

Write unit tests!

December 7, 2015
By
Write unit tests!

Since 2000, I’ve been working on R/qtl, an R package for mapping the genetic loci (called quantitative trait loci, QTL) that contribute to variation in quantitative traits in experimental crosses. The Bioinformatics paper about it is my most cited; also see my 2014 JORS paper, “Fourteen years of R/qtl: Just barely sustainable.” It’s a bit […]

Read more »

It’s not you, it’s me

September 24, 2015
By
It’s not you, it’s me

Somehow when my code stops working, my first (and second, and third) reaction is to blame everything except my own code. (“It’s not me, it’s you.”) And almost always, it’s my own code that’s the problem (hence the title of this post). I spent the day trying to resolve a bug in my early-in-development R […]

Read more »

It’s not you, it’s me

September 24, 2015
By
It’s not you, it’s me

Somehow when my code stops working, my first (and second, and third) reaction is to blame everything except my own code. (“It’s not me, it’s you.”) And almost always, it’s my own code that’s the problem (hence the title of this post). I spent the day trying to resolve a bug in my early-in-development R […]

Read more »

Randomized Hobbit

June 22, 2015
By
Randomized Hobbit

@wrathematics pointed me to his ngram R package for constructing and simulating from n-grams from text. I’d recently grabbed the text of the hobbit, and so I applied it to that text, with amusing results. Here’s the code I used to grab the text. Then calculate the ngrams with n=2. Simulate some number of words […]

Read more »

Randomized Hobbit

June 22, 2015
By
Randomized Hobbit

@wrathematics pointed me to his ngram R package for constructing and simulating from n-grams from text. I’d recently grabbed the text of the hobbit, and so I applied it to that text, with amusing results. Here’s the code I used to grab the text. Then calculate the ngrams with n=2. Simulate some number of words […]

Read more »

Error notifications from R

September 5, 2014
By
Error notifications from R

I’m enthusiastic about having R notify me when my script is done. But among my early uses of this, my script threw an error, and I never got a text or pushbullet about that. And really, I’m even more interested in being notified about such errors than anything else. It’s relatively easy to get notified […]

Read more »

Notifications from R

September 3, 2014
By
Notifications from R

You just sent a long R job running. How to know when it’s done? Have it notify you by beeping, sending you a text, or sending you a notification via pushbullet. beepr You can use Rasmus Bååth’s beepr package to have your computer play a sound. Install it from CRAN with Then, at the bottom […]

Read more »

Why hadn’t I written a function for that?

July 17, 2014
By
Why hadn’t I written a function for that?

I’m often typing the same bits of code over and over. Those bits of code really should be made into functions. For example, I’m still using base graphics. (ggplot2 is on my “to do” list, really!) Often some things will be drawn with a slight overlap of the border of the plotting region. And in […]

Read more »

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 »


Subscribe

Email:

  Subscribe