Getting started with R
This blogpost was for a friend who needed help learning
R. If you're new to
R, this should help you too. Also, I'm quite new to
Rmyself and am not an expert by any means.
R is a really simple language you can use to study and analyze data. You can also generate graphs like the one below.
- Download the setup for
Rfrom CRAN: https://cran.r-project.org/bin/windows/base/
- Run the setup and follow the steps on screen to complete installation
Rfrom CRAN: https://cran.r-project.org/bin/macosx/
- Run the setup and follow the onscreen instructions.
R can also be easily installed using
homebrew. Ensure you've got
homebrew setup first. Then install the
r package using homebrew by typing the following in the terminal:
$ brew install package r
The following worked on my VM running Ubuntu 16.04 LTS
$ sudo apt-get install r-base
If that doesn't work for you, follow the instructions here.
If you don't want to install
R on your computer yet, you can use R Fiddle. You'll eventually want to have
R installed though.
R Studio is a nice cross platform IDE for
R. You can download and install it from here.
R-Studio is free only for non-commercial use.
I found 4 good resources that helped me get started. The first two are particularly very good.
R: A Self Learn Tutorial (PDF) by National Center for Ecological Analysis and Synthesis, California.
- Video Lessons by Neo Christopher Chung and David Robinson.
- Beginner's guide to R by Computer World. The PDF available can be downloaded from here on registration.
- An interactive
Rtutorial by CodeSchool for those who like it slow.
As with learning any other programming language, typing the code/command is important. Don't copy-paste. Always type. And type as many commands as you can. Even the examples. You might not like it at first, but you'll thank yourself later.
If you get stuck, try using google search. Or check the R documentation here. If these don't help try asking someone.
Stackoverflow & Cross Validated are sister-sites you can get help from. Ask on stackoverflow if your question is more programming related, and on Cross Validated if your question is more statistics related. Make sure you read the Help Center of the respective sites before posting a question.
I've been working on a really cool project for quite sometime now and I can't wait to use
R to study its data :D