Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 2.56 KB

block00_setup.md

File metadata and controls

47 lines (33 loc) · 2.56 KB

R and RStudio Set Up

R and RStudio

Testing testing

  • Do whatever is appropriate for your OS to launch RStudio. You should get a window similar to the screenshot you see here, but yours will be more boring because you haven't written any code or made any figures yet!

  • Put your cursor in the pane labelled Console, which is where you interact with the live R process. Create a simple object with code like x <- 2 * 4 (followed by enter or return). Then inspect the x object by typing x followed by enter or return. Obviously you should see the value 8 print to screen. If yes, you are good to go.

Add-on packages

R is an extensible system and many people share useful code they have developed as a package via CRAN and github. To install a package from CRAN, for example the plyr package for data aggregation, here is one way to do it in the R console (there are others).

  install.packages("plyr", dependencies = TRUE)

We will use this package soon, so go ahead and install it!

Another package we will use soon is knitr, which facilitates the creation of dynamic reports. You can install it in the same way.

  install.packages("knitr", dependencies = TRUE)

Further resources

The above will get your basic setup ready but here are some links if you are interested in reading a bit further.

This work is licensed under the CC BY-NC 3.0 Creative Commons License.