Pipes in R

The other day someone posted a link to this python package which provides a bash-style pipe operator to manipulate streams through a series of transformers. It seemed like a cool and powerful way of doing the usual data pre-processing / munging I often do in python.

But what about R? I also do a lot of processing in R and to me this pipe metaphor also seemed like a natural way of iterating over data frames. So the other day I set about trying to implement an R-thonic pipe operator and about 50 lines later I succeeded. It’s actually more robust and featureful than what I’ll describe below, but even in these simple use cases I can see it making manipulating data much easier.

Read more here: http://www.facebook.com/notes/jonathan-chang/pipes-in-r/10150174062816212



Filed under Uncategorized

6 responses to “Pipes in R

  1. Bob Carpenter

    That link is behind Facebook’s registration wall, and thus invisible to me. Why not put it on CRAN?

    Have you tried Google Distill or Hadley Wickham’s plyr in R? I’ve heard that they’re very nice, but haven’t tried either one.

    • Sorry, I was giving my employer’s product a shot =). It’s not ready for prime time yet but when it is I’ll probably upload it to r-forge (I find CRAN to be a pain sometimes, especially for stuff still under development).

      I haven’t tried Distill but I absolutely love plyr! Its simplicity inspired a lot of the functionality in this package.

    • Edwin Chen

      What’s Google Distill? I can’t find any mention of it anywhere.

      (I agree with Jonathan that plyr’s amazing. It singlehandedly made me fall in love with R.)

  2. Hi Jonathan,
    I find your name on the PC-member list of ICWSM. I’m a pc member too. Would you mind writing me an email? I want to ask you a question not relevant to your site.

  3. François

    That link is not only behind FB’s registration wall, it’s also behind my company’s firewall, which forbids facebook at work. Can’t read.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s