Take the interactive quiz
Now you try. Your data should already be loaded. (Look in the Environment tab. If there are no variables, you’ll have to rerun exercise one.) In this exercise you’ll practice the dplyr
verbs mentioned in the lecture:
arrange()
filter()
mutate()
select()
count()
All of the following questions are based on the sample of restaurants represented in the dataset which is accurate as of September 2, 2016.
Which restaurant has the lowest cost item and what is the item?
Which restaurant has the most expensive item(s)? What are those item(s)?
At the Brodhead Center, how many of the entrees (found in the menuType
variable) cost eight dollars?
The head of Duke dining is considering reducing prices at the Brodhead Center. Using what we’ve learned in class, write a line of code that will calculate a new variable (halfPrice
) that contains items at half price.
How many entrees are in the dataset (menuType
variable)? How many desserts
See the answers to the above section