Friday, September 28

R Cheat Sheet - Data Frames

I have been working with R for a few years now. It is a powerful yet utterly frustrating computer language to learn. It feels like a maze of twisty little passages which are all different yet similar.

For someone from the curly-bracket family of languages (C, C++, Java, Objective-C), R is both hauntingly familiar and completely alien. There is often ten different ways to do much the same thing. Sometimes there will be no difference. Sometimes there are subtle and deep differences which don't matter most of the time. And sometimes these differences raise their head to get you at the most inconvenient time.

One of the ways I learn a language it to put together cheat sheets as I go along. These normally cover the basic syntax of the language, the core functions, and some of the idiom of the language. With R, I have found that I need a lot more cheat sheets than usual.

In this process, I have one cheat sheet that I am relatively happy with when it comes to sharing with others: my R Data Frames Cheat Sheet. Data frames are the work horse of R.

If you can see any errors or if you know of better ways to manipulate data frames: Let me know.


  1. Very nice and clear, thanks for sharing.

  2. This is a great resource. I would love to use it and share it with all my friends and coworkers. Alas it is written in Comic Sans. I guess I will have to find a different cheat sheet.

  3. Fantastic resource. Thanks. Which book did you use for your studies