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.
devtools::install_github("hathawayj/buildings")
and find out what data is in the packageclimate_zone_fips
data to the buildings0809
data using the two FIPS
columns for state and county.Food_Beverage_Service
group of buildings in the Type
variable, use the ProjectTitle
column to create new subgroups from the groupings in the code section below and the restaurant names in restaurants
.
Full Service Restaurants
and be in Quick Service Restaurants
if they are under 4000 square feet and new construction.str_to_lower()
and str_trim()
to get all the words in a standardized formcase_when()
function to create the subgroups..Rmd
file with 2-3 paragraphs summarizing your 3-4 graphics that inform the client questions.md
and .html
file into your git repositorynot_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"