Sunday, August 11, 2013

R Reference Sheet

Recently I have been spending a lot of time learning about the statistical environment R.  R is command line based and is worth learning because it is more powerful than programs like Excel, and ultimately it saves a lot of time (especially when you will have to perform repetitive tasks or if you will have to redo the analysis again with updated data).  I am still new at R, but I have been learning a lot and I want to share that with others who are learning.

First of all, you can download R by clicking the 'download, packages' CRAN link on the left of the homepage.  Just follow the directions.  In addition to using R, there is a nice program for writing R scripts called R Studio, which has more features in a nice GUI.  It kind of reminds me of the way SAS is set up, and it is worth a try for sure.



To keep track of what I have learned about R, I decided to start an R summary sheet.  Most of the information I have in this summary can be found across the internet, but I decided to try to get the parts I thought were relevant into one place for quick reference.  As I started this summary sheet, I focused on some basic statistical tests (which I end up using a lot), as well as some graphing commands using ggplot2 (something else I have been using a lot).  The dataset I used throughout the summary sheet was mtcars, which is a standard set of data integrated into the R {datasets} package.

In my R summary sheet, I included some commands for the standard Wilcoxon and Kruskal-Wallis tests, multiple hypothesis corrections, and the Shapiro-Wilk test for normality of data.  I also included some commands and notes for graphing with 'ggplot2', a popular graphing package for R.  It is more difficult to use than the base graphics included with R, but it offers a lot more functionality.

I uploaded my R summary sheet to my website.  Check it out here under 'R_notes_summary.R'.



Works Cited

R Image from: http://developer.r-project.org/Logo/Rlogo-1.png


No comments:

Post a Comment