Founded in Seattle, WA in 1971, Starbucks Corporation is the world’s largest coffeehouse chain. With 23,768 locations worldwide, 13,107 of which located in the United States, Starbucks brands itself as a “second wave” coffee house that offers superior quality and service.
According to our research, 83% of Starbucks locations cater to white communiities. The two hypothesis we’d like to test are:
## # A tibble: 10 × 3
## Country Total Percentage
## <chr> <int> <dbl>
## 1 US 13608 53.16
## 2 CN 2734 10.68
## 3 CA 1468 5.73
## 4 JP 1237 4.83
## 5 KR 993 3.88
## 6 GB 901 3.52
## 7 MX 579 2.26
## 8 TW 394 1.54
## 9 TR 326 1.27
## 10 PH 298 1.16
## # A tibble: 10 × 3
## state Total Percentage
## <chr> <int> <dbl>
## 1 CA 2821 11.02
## 2 TX 1042 4.07
## 3 ENG 787 3.07
## 4 WA 757 2.96
## 5 11 706 2.76
## 6 FL 694 2.71
## 7 NY 645 2.52
## 8 31 580 2.27
## 9 IL 575 2.25
## 10 AZ 536 2.09
## # A tibble: 4 × 3
## `Ownership Type` Total Percentage
## <chr> <int> <dbl>
## 1 Company Owned 11932 46.61
## 2 Licensed 9375 36.62
## 3 Joint Venture 3976 15.53
## 4 Franchise 317 1.24
```*** NEEDS FIXING**
income <- read_csv(“https://raw.githubusercontent.com/IBSBigData/BUS256TeamE/master/income.csv?token=AY4rQleHlRuBRgTlKwfbWh3n9P3mtvYjks5ZCMJ-wA%3D%3D”)
income <- rename(income, c(postalcode=“state”))
map <- US[,c(6:7,12:13)]
new <- merge(x =map, y = income, by = “state”, all.x = TRUE)
new <- na.omit(new)
new\(household_income <- as.numeric(new\)household_income)
ag <- aggregate( map\(state ~ income\)household_income + map\(Longitude + map\)Latitude, FUN = mean)
ag <- rename(ag, c(new$state =“state”, new$household_income=“household_incomee”, new$Latitude=“Latitude”,new$Longitude=“Longitude”))
qplot(data=ag, Longitude, Latitude, group=state , fill= household_incomee, geom=“polygon”) ############ Map <- gvisGeoChart(ag, “state”, “household_incomee”, #select the state and number of stores options=list(region=“US”, # Map from the US displayMode=“region”, colorAxis=“{colors:[‘green’]}”, backgroundColor=“lightblue”, chartid=“EQ”, resolution=“provinces”,# Displays the regions width=1200, height=900)) # Controls the size plot(Map) #############
states <- map_data(“state”)
states <- rename(states, c(region=“state”))
map.df <- merge(states,ag, by=“state”, all.y=T)
map.df <- na.omit
map.df <- map.df[order(map.df$order),]
ggplot(map.df, aes(x=Longitude,y=Latitude,group=state))+ geom_polygon(aes(fill=state))+ geom_path()+ scale_fill_gradientn(colours=rev(heat.colors(10)),na.value=“grey90”)+ coord_map()
AndrewMap <- gvisMap(US, “LatLong” , “Tip”, options=list(showTip=TRUE, showLine=TRUE, enableScrollWheel=TRUE, mapType=‘terrain’, useMapTypeControl=TRUE)) plot(AndrewMap)
```