Skip to content

gaiusjaugustus/intro-r-20170825

Repository files navigation

R Workshop: August 26-27, 2017

This repository acts as a companion for the R programming portion of the Software Carpentry Workshop being held at University of Arizona.

Start Your Exciting R Adventure Here!

Every adventure starts with getting the supplies you need. To prepare for the R portion of the workshop, you'll need to get the data we'll be using and some fancy addons to R!

1. Clone the repo one of 2 ways

Using git

There are two ways to do this, the first using the command line.

  1. In your Terminal (Mac) or Git Bash (Windows), type cd and press Enter. This takes you back to your home directory, then cd (change directory) into the SDC_workshop_20170826 directory.
  2. On the main page of the repo, click the word Fork at the top right of the page. This will copy the repo into your GitHub account.
  3. You should now be in your own intro-r-20170825 repo. Click the green button that says Clone or download.
  4. Click the copy to clipboard button that is next to the URL
  5. Back in your terminal, type git clone URL where the URL is the what is in your clipboard.
  6. Check your work by using ls to verify that there is now a folder called intro-r-20170825 in your home directory.
  7. Copy the gapminder.txt file you created into intro-r-20180825/datasets/. If you have any trouble, there is a backup for this, called gapminder_backup.txt.

Unzip the repo

  1. Open R Studio. You should see a box labelled Console, and there should be a > at the beginning of the line where you can type. Type getwd() and Enter to find your HOME directory. Teaser: This is the R equivalent of pwd in Unix.
  2. On the main page of the repo, click the word Fork at the top right of the page. This will copy the repo into your GitHub account.
  3. You should now be in your own intro-r-20170825 repo. Click the green button that says Clone or download.
  4. Click the Download Zip link and download the file.
  5. Unzip the downloaded archive into HOME/SDC_workshop_20170826 (you identified HOME in step 1).
  6. Check your work by going to HOME/SDC_workshop_20170826 and verifying there is now a folder called intro-r-20170825-master there. You may want to rename it intro-r-20170825. Inside this folder, you should see multiple folders.
  7. Copy the gapminder.txt file you created into intro-r-20180825/datasets/. If you have any trouble, there is a backup for this, called gapminder_backup.txt.

2. Install packages

Open RStudio and run the following lines of code in the box labelled Console. You should see a > at the beginning of the line where you can type. This installs additional functionality to R so that we can do all sorts of cool stuff! Note: When you press Enter after putting in this command, it's going to take 3-6 minutes to install everything. Your patience will be rewarded.

install.packages(c("knitr", "scales", "ggthemes", "tidyverse", "readxl"))

What did I just install? You just added some great functionality to R. These are called packages, and they work like addons or plugins. knitr will allow you to create reports that are human readable and pretty that you can share with your boss, your parents, your dog...anyone. tidyverse is a suite of packages that use more human readable code to import and manipulate data in R. readxl lets you read in excel files, and while we won't cover it in this course, it's really useful and you should have it installed! scales and ggthemes are two packages that add features to a plotting package that was downloaded as part of the tidyverse package, called ggplot2. ggthemes adds color palettes and visual options, while scales allows us to customize a plot's axes more.

What are we going to actually cover?

A little help from our friends...

If you want more help, check out the resource list.

Your R instructors

Gaius Augustus

Elizabeth Bowman Github Research Lab I am a graduate student in.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages