Activity #2: Practice Graphing in R

For the lab assignment, you will use the SimpleRGraphs tutorial to walk through introductory graphics in R. When you are finished, you should feel confident making graphs in R.

Learning Objectives:

Installation

Linking your Github and Rstudio

This tutorial was built in and works within Rstudio but it also works in web browsers. The packages developed for this tutorial are hosted on Github, so you will need to make sure that your Rstudio and Github are linked for a smooth installation. If you do not have Github and Rstudio configured to work together, please visit this gist to get setup!

Programs to download outside of Rstudio

Mac Users will need Xcode developer tools from the App store in order to use devtools
Windows Users will need Rtools from CRAN in order to use devtools

Now install the tutorial!

If you do not have learnr & devtools installed already, use the commented(#) lines in the code chunks below before running library()

First: You will need learnr to run this tutorial (or create your own - learnr documentation):

# Run the install line ONCE
install.packages("learnr")

library(learnr)

Second: Install the development version of the tutorial from GitHub with devtools:

# Run the install line ONCE
install.packages("devtools")

library(devtools)
devtools::install_github("adc0032/SimpleRGraphs")

Third: This tutorial package has an accompanying data package that can be accessed from GitHub with:

devtools::install_github("adc0032/WILD7150")

The package also requires tidyverse, but you should be prompted to install if you do not have it installed already.

Running

To start the tutorial in a web browser (pref. Google Chrome), run the following command in your console:

learnr::run_tutorial("simplergraphs", package = "SimpleRGraphs")

Additionally, you should now have a “Tutorial” tab, where you can access “Simple Graphs in R” by clicking Start Tutorial This will start the tutorial in an Rstudio window Tutorial Pane

Next page:

Module 5: Advanced Graphing in R