Posted by: Dave | February 17, 2009

R: A Quick Overview

Recently, the blogosphere’s been full of talk of R, the programming language for statisticians and data analysts. Even the New York Times had an article on R.

I consequently  felt the need to see what all the talk was about. 

R is a Statically Scoped, Weakly Typed programming language. It is an open source project available for most platforms from the R Projects website.

I installed R and went through a few basic tutorials on-line – just to get the feel for it.

To me, it feels more like a computational environment than an traditional programming language. It definitely reminds me of my MATLAB, Maple, and Octave * days. However, according to the R Project’s page on R, “For computationally-intensive tasks, C, C++ and Fortran code can be linked and called at run time. Advanced users can write C code to manipulate R objects directly. ” Although that does sound more like a programming language to me, the environment still allows for quick commands. For example, you can quickly fire up R and type ‘1+2’. This is a power that you don’t get with a language like C. Some people would consider R like ‘Excel with a command prompt’. 

In Windows, the R GUI Environment consists of a command prompt, a script editor, a plot window, and a data editor. You can  do anything you want through the command prompt. Plots appear in the plow window. You can use the data editor to edit data sets in spreadsheet fashion.  The script editor allows you to type up commands and save them for later.  In Linux, fire up R by typing ‘R’ at the command prompt. From there on you’re in R-mode.  

R Windows GUI Environment 
R Windows GUI Environment

I am, however, struggling with how to write an actual ‘program’ in R. So far the best that I’ve been able to manage is a collection of commands that I can either run individually or as a group.  

After playing with R for a little while, it definitely feels like a language only worth learning if you have a need or interest in stats/data analysis **

R In Linux

R In Linux

* Not that I’m implying that MATLAB, Maple, and Octave aren’t real languages! 
** I hate to say ‘only worth learning if [any condition], but you get the idea 😉 .


Leave a Reply

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

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s


%d bloggers like this: