RStudio: Easy to Use Interface For R and Google Analytics Data #measure Part One: Setup

RStudio: FOSS Interface to R

The limitations of widely used existing business solutions for statistical programming have led many organizations previously opposed to FOSS solutions deploy R.

With the release of RStudio the bar to gain entry into the world of R has been lowered so dramatically there is functionally no excuse aside laziness to avoid R.

In part One of this series we will set up RStudio, in Part Two we will pull data from the Google Analytics API and chart up some cool charts. All that in less than 30 minutes.

Your choice. Red pill or blue.

Install R

There are numerous exemplary instructions on how to install R for your computer, the high notes are:

Linux

I would start with the GUI for your software manager, Synaptic on Debian/Ubuntu. Look under the “GNU R statistical programming sections.”

Select, download, install, get going with your life.

Windows

Windows installers exist; a detailed FAQ for R on Windows is available on the CRAN website.

There is even a slick plug-in for Excel called RExcel freely avaialble on the RExcel website.

Mac

The FAQ for R on Mac is ‘rather incomplete,‘ their words, but according to the documentation it can be installed on OS X 10.2+.

RStudio

There is a company with the same name, so make sure you navigate to the correct RStudio site: http://rstudio.org/.

RStudio: Server or Desktop?

After selecting that you want to download RStudio, you are presented with the option to download either the Desktop or Server version. Select the appropriate version for your use, I’m guessing Desktop.

R on a server? What, you never heard of rApache?

Select RStudio Version

RStudio politely suggests the appropriate version of the software for you, since I use Linux I get to see Tux next to my version.

Install RStudio

After downloading RStudio, install it as appropriate for your OS. I used GDebi and it went so smooth I forgot to even take a screen capture!

Starting RStudio

When you start RStudio the utility of the program is pretty apparent. I love, no I LOVE the integrated packages panel and documentation in the lower right.

R is fantastic, the one pain is documentation can be a bit . . . scattered depending on who is the maintainer of the package.

I know, they can all be found on Crantastic. RStudio saves me that time I had to click over to my browser bookmarks, find the package in Crantastic and find the documentation.

Serenity now.

Load The Iris Data Set Via Web URL

Another slight time saver is the “Import Dataset” option in the panel above the documentation panel.

Select the option, and then “From Web URL…” and enter the URL of your data. In our test case we are using the Iris data set at the UCI Machine Learning Repository:

http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data

After you paste the URL into the dialog box, RStudio returns something like this:

I’m not sure that could get any easier.

Working in R

Once you approve the data by selecting “Import” you are returned to RStudio with the left hand side showing the data set above the interactive terminal.

There are numerous tutorials for R, having read too many of them I recommend “Using R for Data Analysis and Graphics: Introduction, Code and Commentary” by Dr. Maindonald of the Centre for Mathematics and Its Applications, Australian National University.

Well written and very approachable, start out with the Iris data set and move onto the more complex data sets available at UCI.

RGoogleAnalytics

In less than the time you spent setting up RStudio we will pull data and generate some really slick charts from the Google Analytics API in the next post.

If you have any questions, need help or are just curious about deploying R in your enviroment feel free to send me an email mdh@michaeldhealy.com.

Technorati Tags: FOSS, Google Analytics, R, RStudio

Share
This entry was posted in Analytics, Google Analytics, R, Tools and tagged , , , . Bookmark the permalink.

One Response to RStudio: Easy to Use Interface For R and Google Analytics Data #measure Part One: Setup

  1. Tal Galili says:

    Hi there,
    A friend just shared with me the link to your blog, and I would like to invite you to join:
    http://www.r-bloggers.com/add-your-blog/

    Cheers,
    Tal

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>