Archives by date

You are browsing the site archives by date.

Abstract Data Type Operations in R

This morning, I got a chance to read enough of the R Language Definition to finish my implementations of push and pop. While I was at it, I also wrote implementations of unshift, shift, queue and dequeue. Here they are: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 […]

R Function Usage Frequencies, Take 2

Yesterday, Hadley Wickham commented on my post on the frequency of calling various R functions that it would be helpful to have the number of packages that call a function in addition to the number of times that the function is called. I compiled the relevant data last night: you can grab it here This […]

Implementing Push and Pop in R

Having grown up with Perl, there are two functions that I desperately miss while programming in R: push and pop. Continually writing 1 vector <- c(vector, new.entry) tries my patience, while writing 1 2 vector <- rep(NA, inscrutable.constant) vector[inscrutable.index] <- new.entry makes me feel like I’m programming in C, rather than a higher-level programming language. […]

R Function Usage Frequencies

A few months ago I decided to apply word frequency analysis ideas to R code. My idea was simple: the functions that one should invest the most effort into learning are precisely those functions that are used most frequently in real world code. In fact, this simple idea can be applied to spoken languages as […]

The Young and the Restless

I’ve held onto old codes of honor like the captain to a sinking ship. The world moved on and rolled its eyes, but there are some things that are worse than dying. It’s always been my way to over-romanticize, cuz’ when I was young I had a hard time with what was real and fantasized. […]

How Big Businesses Work to Conserve Resources

This NYT piece by Jared Diamond is remarkable for its clear real-world examples of the ways in which businesses will independently discover ways to conserve resources, simply because minimizing wastefulness is profitable. HT: Marginal Revolution

Paul Meehl via Andrew Gelman

Andrew Gelman points out that there is now a website devoted entirely to Paul Meehl. In my mind, Paul Meehl was one of the greatest psychologists of the 20th century. Few other people in our field were more level-headed or insightful. Every paper written by Meehl is a delight to read, so this is a […]

Cleaning Up an iTunes Library with MacRuby

For a little more than a year now, I’ve been meaning to write a script to rename all of the files in my iTunes library so that they’re in proper English title case. In large part, this project was inspired by reading John Gruber’s post about a Perl script that he’d written to convert text […]

Suggestions for TextMate’s Search and Replace

Like so many other programmers, I adore TextMate. For that reasons, here are two simple features that I’d enjoy seeing in the next version: A case-preserving search and replace tool. If I search for a string like my_class and want to replace it with my_new_class, I’d like my_class to transform into my_new_class at the same […]

The Sort of Men Involved in Domestic Abuse

Here’s a real testament to the strength of character of men who beat their wives: they beat them more when their favorite sports team loses.