Please upload your final completed lab on the Assignments page in Canvas, as per the instructions below.
You are welcome and expected to ask for help from the instructors if you get stuck: Please also come to the R Bootcamp on Friday—there is coffee and snacks!
In this lab, we will continue to work with data from the Harry Potter series of moving pictures.
Use the three vectors from last time.
year <- c(2001, 2002, 2004, 2005, 2007, 2009, 2010, 2011, 2016) prod_budget <- c(125000000, NA, 130000000, 150000000, NA, 250000000, 125000000, 125000000, 180000000) ww_boxoffice <- c(974755371, 878979634, NA, 896911078, NA, 935083686, 960283305, 1341511219, 803798342)
Using the vector
year, create an object of all the years with films after 2005.
prod_budget to create a vector of production budgets without any missing data.
Subset this new vector to contain all values greater or equal to 150,000,000.
ww_boxoffice to create a vector with no missing data.
Subset this vector to create a new vector of values less than 900,000,000.
Remove the second element from this new vector.
Add the correct film title epithet (e.g., “Sorcerer’s Stone”) as names for the remaining elements in this vector.
Subset one of them by name.
Please check the help page for a reminder, if you need to.