-
Notifications
You must be signed in to change notification settings - Fork 609
/
Copy pathexercise.R
34 lines (15 loc) · 969 Bytes
/
exercise.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
32
# Exercise 2: Data Frame Practice with `dplyr`.
# Use a different appraoch to accomplish the same tasks as exercise-1
# 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
# You should have have access to the `vehicles` data.frame
# Create a data.frame of vehicles from 1997
# 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
# Of those vehicles, what is the vehicle ID of the vehicle with the worst hwy mpg?
# 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
# What was the most efficient honda model of 1995?