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.
There are numerous exemplary instructions on how to install R for your computer, the high notes are:
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 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.
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+.
There is a company with the same name, so make sure you navigate to the correct RStudio site: http://rstudio.org/.
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.
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!
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.
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:
After you paste the URL into the dialog box, RStudio returns something like this:
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.
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 firstname.lastname@example.org.