is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. “R
” is also a software that interprets the scipts written using it. The most popular way to interact with R is by using RStudio. To get started you need to install R and RStudio on your computer.
?help
info will appearNeed further convincing to user R…read on
Windows
If you already have R and RStudio installed:
sessionInfo()
, which will also display which version of R you are running. Go on the CRAN website and check whether a more recent version is available. If so, please download and install it. You can check here for more information on how to remove old versions from your system if you wish to do so.If you don’t have R and RStudio installed:
.exe
file that was just downloadedMacOS
If you already have R and RStudio installed:
sessionInfo()
, which will also display which version of R you are running. Go on the CRAN website and check whether a more recent version is available. If so, please download and install it.If you don’t have R and RStudio installed:
.pkg
file for the latest R versionR
!R is much more than statistics, and making graphs, it is a never-ending tool that is constantly being updated. Before we know it R will be able to cook your dinner and go to the shops too! But for now check out its great range of features for project management. It can talk all types of coding languages, and is useful to keep track of exactly what you are doing. You can even make your own webpage to help keep track of all that code and information, just like I am doing here!
Some links to get you started:
No matter what you use RStudio for you’ll need to install some packages. Think of these as like add ins, there are loads out there. If they are available on CRAN you can install using install.packages("package")
, if not on CRAN most will be downloading using devtools::install_github("package/repo")
, just make sure you install.packages("devtools")
first. You only need to install once so usually do this by typing straight into the Console
and then you will need to load your packages using library(package)
, you can save the R environment so when you reopen it should be there but its a good idea to ensure you always load libraries you will need at the start of the session.
Here’s some good places to start find packages:
As a general rule these pages on RStudio are not meant as a stand alone tutorial/workflow to learn coding. Generally they includes lots of links to people who have done the hard work, and I just have a small subset of code that is relevant to my workflow or some common code chunks I use. So please read on with caution - mostly this is just a place for me to collate some websites/tutorials/information that I have found useful during my research in one central location.
Work by Siobhon Egan
siobhon.egan@murdoch.edu.au