MET581 Lecture 04 Homework

Wrangling Data 2

Author

Matthew Bracher-Smith

Published

October 18, 2024

This document contains all questions for lessson 4. Please create a Quarto document containing all text, code and output used to answer the questions.

  1. Explain how escapes work in R with respect to regular expressions

  2. List and describe the tidyverse commands used to join two datasets together. What two key arguments can you use to prevent mistakes in your joins?

  3. Load the nycflights13 package and join the datasets flights and airlines together, selecting only the columns: year, month, day, hour, origin, tailnum and carrier from flights. Can you do the same but using the mutate() function instead?

  4. In the starwars dataset and in one command, add two new columns:

  1. Download the gene annotation file from the NCBI found here

unzip the file and load in NCBI37.3.gene.loc into R