R homework

Author

Jelmer Poelstra

Published

January 29, 2024


R homework for the week 4 lab

If you have limited or no experience with R, I highly recommend that you go through part of the Data Carpentry “Data Analysis and Visualisation in R for Ecologists” lesson.

At least make your way through:

If you have time, then you can also go through:

You can do this homework either with your own R & RStudio installation (the Carpentry lesson contains installation instructions), or use RStudio at OSC (see the instructions below).

If you run into any issues when going through this material, or just have questions, don’t hesitate to email Jelmer.

Not sure if you know enough R to skip this?

The best way to find out is to take a look at the material!


Start an RStudio session at OSC

In case you want to use RStudio at the Ohio Supercomputer Center (OSC) for your homework, follow these instructions to get started:

  1. Log in to OSC at https://ondemand.osc.edu

  2. Click on Interactive Apps (top bar) and then RStudio Server (all the way at the bottom)

  3. Fill out the form as follows:

    • Cluster: Pitzer
    • R version: 4.3.0
    • Project: PAS2250
    • Number of hours: 4
    • Node type: any
    • Number of cores: 2
Click to see a screenshot

  1. Click the big blue Launch button at the bottom

  2. Now, you should be sent to a new page with a box at the top for your RStudio Server “job”, which should initially be “Queued” (waiting to start).

Click to see a screenshot

  1. Your job should start running very soon, with the top bar of the box turning green and saying “Running”.
Click to see a screenshot

  1. Click Connect to RStudio Server at the bottom of the box, and an RStudio Server instance will open in a new browser tab. You’re ready to go!

Having trouble installing the tidyverse package?

If you are using RStudio at OSC and the installation of the tidyverse package (or another package) with install.packages() fails, please load the packages that the Carpentries lesson uses as follows (no installation needed):

custom_library <- "/fs/scratch/PAS2250/ENT6703/share/rlib"
.libPaths(custom_library)
library(tidyverse, lib.loc = custom_library)
library(hexbin, lib.loc = custom_library)
library(patchwork, lib.loc = custom_library)
library(RSQLite, lib.loc = custom_library)


Back to top