Skip to Main Content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

Using R for Data Wrangling, Analysis, and Visualization: Home

Workshop guide for Using R for Data Wrangling, Analysis, and Visualization

Workshop Agenda

Thursday, September 9th, 2:00 - 4:00 PM

 

  1. R and RStudio Installation
  2. More about RStudio - interface, projects, working directory
  3. R package installation
  4. Objects, functions, and comments
  5. Vectors and data types
  6. Missing data
Installation for PC
  1. Download R from https://cran.r-project.org/bin/windows/base/
  2. Download RStudio at https://www.rstudio.com/products/rstudio/download/#download
Installation for Mac
  1. Check your version number and make sure to download the correct version of R/RStudio.

  2. Download R from https://cran.r-project.org/bin/macosx/, and select the .pkg link based on your macOS version.

  3. Download RStudio at https://www.rstudio.com/products/rstudio/download/#download

R & RStudio Installation Guidance

https://rpubs.com/Earlien/guide-to-installing-R

Course Materials
Recording

Thursday, September 16th, 2:00 - 4:00 PM

  1. Data frames and tibbles
  2. Factors
  3. Dates
  4. Data wrangling with dplyr

 

About the Dataset

The data used for this lesson are in the figshare repository at: https://figshare.com/articles/SAFI_Survey_Results/6262019

This lesson uses SAFI_clean.csv. The direct download link for this file is: https://ndownloader.figshare.com/files/11492171

Course Materials
Extra Materials
Recording

Thursday, September 23rd, 2:00 - 4:00 PM

  1. Reformat data with tidyr
  2. Export data
  3. About ggplot
  4. Building your plots iteratively
  5. Boxplots
  6. Bar charts
  7. Faceting
## Not run, but can be used to load in data from previous lesson!
interviews_plotting <- interviews %>%
  ## pivot wider by items_owned
  separate_rows(items_owned, sep = ";") %>%
  ## if there were no items listed, changing NA to no_listed_items
  replace_na(list(items_owned = "no_listed_items")) %>%
  mutate(items_owned_logical = TRUE) %>%
  pivot_wider(names_from = items_owned, 
              values_from = items_owned_logical, 
              values_fill = list(items_owned_logical = FALSE)) %>%
  ## pivot wider by months_lack_food
  separate_rows(months_lack_food, sep = ";") %>%
  mutate(months_lack_food_logical = TRUE) %>%
  pivot_wider(names_from = months_lack_food, 
              values_from = months_lack_food_logical, 
              values_fill = list(months_lack_food_logical = FALSE)) %>%
  ## add some summary columns
  mutate(number_months_lack_food = rowSums(select(., Jan:May))) %>%
  mutate(number_items = rowSums(select(., bicycle:car)))

 

Course Materials
Extra Materials
Recording

Pre-survey & Workshop Evaluation

Please fill the pre-survey and evaluation to help us understand your expectations and thoughts about the workshops. 

Popular Style Guides for R

Contact Information

Profile Photo
Jingjing Wu
Contact:
Room 8 (Basement)
TTU Library
806.834.3991

Contact Information

Profile Photo
Cynthia Henry
Contact:
Texas Tech University Library
Room M116
(located on the Mezzanine/Balcony level)
806-834-0898
Skype Contact: cynthia.henry@ttu.edu
Social: Twitter Page