This pre-class assignment should be completed by 8:00am on 02-12-19. Use mtcars
and the functions in the dplyr
package. Try to also make use of %>%
operator where applicable. Once you are done, complete the survey that is available on Google Classroom.
library(tidyverse)
Filter mtcars
for only cars that get at least 20 miles per gallon.
Select columns hp, vs, am, and carb from mtcars
.
Add a new column called kpg
- kilometers per gallon. To get this value, convert the miles per gallon column.
For each cylinder level, compute the mean miles per gallon and mean horsepower.
For each cylinder and transmission combination, compute the standard deviation of miles per gallon, standard deviation of horsepower, and standard deviation of weight.
Redo questions 1 - 5, but do not use the functions in package dplyr
.