-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathexercise2.R
33 lines (16 loc) · 963 Bytes
/
exercise2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#### Exercise 2 ###
# Install devtools package: allows installations from GitHub
# install.packages('devtools')
# Install "fueleconomy" package from GitHub
# devtools::install_github("hadley/fueleconomy")
# Require/library the fueleconomy package
# library(fueleconomy)
# You should have have access to the vehicles data.frame
# View(vehicles)
# Create a data.frame of vehicles from 1997 (using dplyr)
# Use the `unique` function to verify that there is only 1 value in the `year` column of your new data.frame
# Create a data.frame of 2-Wheel Drive vehicles that get more than 20 miles/gallon in the city (using dplyr)
# Of those vehicles, what is the vehicle ID of the vehicle with the worst hwy mpg? (using dplyr)
# Write a function that takes a year and a make as parameters, and returns
# The vehicle that gets the most hwy miles/gallon of vehicles of that make in that year (using dplyr)
# What was the most efficient honda model of 1995?