DataThink Development
  • Modules
  • R Help
  • Resources
    • Course Textbook
    • R for Data Science
    • Git/GitHub and R
    • R Markdown: The Definitive Guide
    • Geocomputation with R

    • Supplemental Material
    • Happy Git and Github for the useR
    • plotly for R
    • Computing in R for Social Sciences
    • Statistical Concepts in Presenting Data:
    • Advanced R
    • R Packages
    • Tidy evaluation
    • Fundamentals of Data Visualization
    • Geocomputation with R
    • Crosstalk: htmlwidgets add-on

On this page

  • Case Study 6: The collapse of construction in Idaho
    • Background
    • Reading
    • Tasks

cs-06

Case Study 6: The collapse of construction in Idaho

Background

It is 2010, and you are working for the Idaho restaurant commission, and they need your help getting a clearer picture of how restaurant construction changed across Idaho from 2008 to 2009. They provided you a dataset of all commercial construction in Idaho for those two years. The data has a variable Type with a general category called Food_Beverage_Service that has other buildings besides restaurants in the category. You will need to use the restaurant names (see restaurants data object) and some additional key words to create the correct subgroupings. Your client expects to provide new data for 2010 and 2011 so your script needs to do the work. Make sure you do not use Excel to manipulate anything.

  1. How did full-service restaurant construction compare to quick service restaurant construction across county and years?
  2. How did restaurant construction fare compare to the other commercial construction in Idaho?
  3. Which county in Idaho spent the most on fast food construction each year?
  4. In that county how did other commercial construction compare?
  • Course Website

Reading

This reading will help you complete the tasks below.

  • o Regular Expressions in R

Tasks

not_restaurants <- c("development","Food preperation center", "Food Services center","bakery","Grocery","conceession","Cafeteria", "lunchroom","school","facility"," hall ")
standalone_retail <- c("Wine","Spirits","Liquor","Convenience","drugstore","Flying J", "Rite Aid ","walgreens ","Love's Travel ")
full_service_type <- c("Ristorante","mexican","pizza ","steakhouse"," grill ","buffet","tavern"," bar ","waffle","italian","steak house")
quick_service_type <- c("coffee"," java "," Donut ","Doughnut"," burger ","Ice Cream ","custard ","sandwich ","fast food "," bagel ")
quick_service_names <- restaurants$Restaurant[restaurants$Type %in% c("coffee","Ice Cream","Fast Food")]
full_service_names <- restaurants$Restaurant[restaurants$Type %in% c("Pizza","Casual Dining","Fast Casual")]
## After the above assignments the below rules need to be implemented
# Over 4,000 ADD and NEW construction get assigned to Sit Down Restaurants
# Under 4,000 sqft NEW construction get assigned to Fast Food
# all Type == "Food/Beverage Service" that don't get grouped based on the above are called "Unknown"