Running R
$$
$$
The nicest way (I think) to use R is to run RStudio. RStudio and R are not the same thing; in fact, you have to download them separately, which you can do here. R is a programming language and Rstudio is a program which allows you to interactively run R code as well as write and execute R scripts and do a number of other things (like create these notes).
When you open RStudio you see something like this:
The top left window (the windows can be re-arranged) is a text editor where one can write lines of code and save them as an R script. One can also edit other types of documents in this window.
The lower left window is curently showing the console. Here you can interactively type R commands and execute them, e.g.
1+1 = 2
.The upper right window is currently showing the environment, which consists of all the “objects” you have created in the currect R programming session. Nothing is there yet.
The bottom right window will show plots when we generate them. It will also open up documentation (help files) when we ask to see these.
When using RStudio, I recommend typing commands into an R script and saving these.