Blog Archives

An R function like “order” from Stata

August 27, 2013
By

A while ago, there was a question on Stackoverflow, Is there an equivalent R function to Stata ‘order’ command?. There isn’t really, and for the most part, you don’t really need one, but I decided that, for fun, I would write one anyway. Instead of operating directly on the data.frames, I decided to just work

Read more »

The “splitstackshape” package for R

August 15, 2013
By

A while ago, a friend of ours presented me with a data problem. Her questionnaire had some questions where the respondent could provide multiple responses. You know, the “Check as many as apply” type of questions. One way that this data is commonly stored is to put a comma separated value into a single cell

Read more »

What exactly is “elegant” code in R?

December 4, 2012
By

In celebration of my achieving 10,000 “reputation” on Stack Overflow, I’m re-posting one of my questions from there that was (as I had expected) deleted after being live for about 5 hours. In that time, I never really got a satisfactory answer, so if anyone wants to offer one in the comments, that would be

Read more »