A Geospatial Equity Analysis of the Massachusetts Cannabis Control Commission on Areas of Disproportionate Impact (ADI)
Despite provisions in the law requiring the Massachusetts Cannabis Control Commission (MCCC) to ensure that people from communities disproportionately harmed by “The War on Drugs” were included in the new legal industry, the progress on implementing a variety of programs to actively engage people from communities of disproportionate impact has been mute. There are numerous avenues and several license types available in this emerging billion dollar industry, yet when looking at the demographics of who is being approved for these license 88% have been issued to white men, only 4% of Final Licenses include ownership from Disadvantaged Business Enterprise (DBE)
We now have the opportunity to redress the historic harm done to those specific individuals and communities by leveraging novel data sets to track Equity Involvement in the MA Cannabis industry. This dashboard leverages MCCC Data to display the geospatial distribution of the MCCC effectiveness in implementing equity provisions that not only translate into full inclusive participation by those disproportionately harmed.
The MCCC has identitifed 29 Areas of Disproportionate Impact throughout the Commonwealth INSERT SUMMARY TABLE HERE
The Commission is charged by state law (St. 2017, ch.55) with ensuring the meaningful participation in the cannabis industry of communities disproportionately affected by the enforcement of previous cannabis laws, small businesses, and companies led by people of color , women , veterans , and farmers . Broadly, the Commission refers to these statutory mandates as its efforts to create an equitable industry . If there is evidence of discrimination or barriers to entry in the regulated marijuana industry, state law directs the Commission to take remedial measures to address those hurdles.
The ADI Filters Tab contols the basemap variables that highlight which Towns meet the filtered data. NOTE: The basemap variables are all linked, so filters remain on the basemap when the navigating between pages.
ADI Filters Tab
The other tab(s) is used to filter the location points. These are the variables that highlight the Applications , Licenses , & Authority
Filters Tab
There are several Feature layers that can be selected to display filtered data on the interactive map. Every location point can be clicked on to popup the data related to the variable.
Select either a dark or grey basemap.
Must feature to display data from navigation bar filters
Displays a Data Table that respond to filters selected from the navigation bar. All of the Data Tables are interactive & can be searched indepedently, or in conjucton with the filters for the Applications, Licenses , & Authority – Multiple rows can be selected that will highlight the data corresponding on the Interactive Map
Data Tab
The Equity Gauges are summary totals of ADI vs Non-ADI Equity Tab
Displays a Pie Chart that responds to the Applications Filters Tab, Licenses Filters Tab, Authority Filters Tabs
---
title: "Cannabis Reparations"
output:
flexdashboard::flex_dashboard:
orientation: columns
theme: cosmo
vertical_layout: fill
source: embed
social: [ "twitter", "facebook" ]
logo: cannabisreparations1.ico
---
```{r setup, include=FALSE}
library(flexdashboard)# interactive dashboard
library(readxl) # import excel data set
library(leaflet) #create interactive maps
library(tidyverse) # load core packages for data visualisation (dplyr:for data manipulation, tidyr:for data tidying, readr:for data import, purrr:for functional programming, tibble:for tibbles, a modern re-imagining of data frames, stringr:for strings, forcats:for factors)
library(DT) #Display data tables
library(crosstalk) # extends htmlwidgets
library(sf) #load shapefiles
library(RColorBrewer) # color palaette
library(geojsonR) # need for geolines
library(shiny)
library(plyr)
library(plotly)
library(lubridate)
library(ggplot2)
library(ggmap)
library(maps)
library(sp)
library(icon)
library(emojifont)
library(geosphere)
```
```{r data, include=FALSE}
Applications <- read_csv("Apps.csv")
License <- read_csv("Lic.csv")
Authority_Entities <- read_csv("AE.csv")
Business_Interets <- read_csv("BI.csv")
Geolines <- read_csv("Geolines.csv")
Applications$combo <- paste(Applications$Application_Status, Applications$Priority_Status,Applications$DBE_Category, Applications$License_Type, sep = "-")
Applications$Date_Created <- as.Date(Applications$Date_Created, format = "%m/%d/%y")
License$Date_Created <- as.Date(License$Date_Created, format = "%m/%d/%y")
License$Date_Submitted <- as.Date(License$Date_Submitted, format = "%m/%d/%y")
License$Date_Final_Licensure <- as.Date(License$Date_Final_Licensure, format = "%m/%d/%y")
# Load Shape Data
ADI_Merged_shape <-st_read("Cannabis_ADI_shape/Cannabis_ADI_shape.shp", stringsAsFactors=FALSE, quiet=TRUE)
ADI_Merged_shape <-st_transform(ADI_Merged_shape,'+proj=longlat +datum=WGS84')
Authority_Entities <- Authority_Entities %>%
mutate(AutAboxinfo = paste0('Authority Name: ', Full_Name, '
',
'Role: ', Role, '
',
'Ownership: ', Ownership, '
',
'Control: ', Control, '
',
'Business Name: ', Business_Name, '
',
'License Status: ', License_Status, '
',
'Priority Status: ', Priority_Status, '
',
'License Type: ', License_Type, '
',
'DBE Category: ', DBE_Category, '
',
'Business Address: ', Business_Address, '
',
'Total Authority Agents: ', Total_Authority_Agents, '
'))
Business_Interets <- Business_Interets %>%
mutate(BIboxinfo = paste0('Authority Name: ', Full_Name, '
',
'Role: ', Role, '
',
'Business Name: ', Business_Name, '
',
'License Status: ', License_Status, '
',
'Priority Status: ', Priority_Status, '
',
'License Type: ', License_Type, '
',
'DBE Category: ', DBE_Category, '
',
'Business Address: ', Business_Address, '
',
'Total Authority Agents: ', Total_Authority_Agents, '
'))
# Generate geolines data
flows <- gcIntermediate(Geolines[,2:3], Geolines[,5:6], sp = TRUE, addStartEnd = TRUE)
flows$Business_Name <- Geolines$business.name
flows$Total_Agents <- Geolines$total.agents
flows$Layer <- Geolines$layer
flows$Ownership <- Geolines$ownership
flows$Control <- Geolines$control
# created shared data for geolines
flows_sd <-SharedData$new(flows)
sd_df <- SharedData$new(flows@data, group = flows_sd$groupName())
# create hover information for geolines
hover <- paste0(flows_sd$data()$Business_Name, " to ",
flows_sd$data()$Priority_Status, ': ',
flows_sd$data()$DBE_Category, " | ",
as.character(flows_sd$data()$Total_Agents))
# Create sharedDataFrames
App_sd <-SharedData$new(Applications, group = "Applications")
Lic_sd <-SharedData$new(License, group = "Licenses")
AE_sd <-SharedData$new(Authority_Entities, group = "Entities")
BI_sd <-SharedData$new(Business_Interets, group = "Interests")
ADI_sd <- SharedData$new(ADI_Merged_shape, group = "ADI")
ADI_sd_df <- SharedData$new(as.data.frame(ADI_Merged_shape), group = ADI_sd$groupName())
#Total
Total_Apps <- nrow(App_sd$data())
Total_Lic <- nrow(Lic_sd$data())
Total_AE <- nrow(AE_sd$data())
Total_BI <- nrow(BI_sd$data())
Impact_Apps <- App_sd$data() %>%
filter(ADI == "ADI")
Non_Impact_Apps <- App_sd$data() %>%
filter(ADI == "Non_ADI")
Impact_Lic <- Lic_sd$data() %>%
filter(ADI == "ADI")
Non_Impact_Lic <- Lic_sd$data() %>%
filter(ADI == "Non_ADI")
Impact_AE <- AE_sd$data() %>%
filter(ADI == "ADI")
Non_Impact_AE <- AE_sd$data() %>%
filter(ADI == "Non_ADI")
Impact_BI <- BI_sd$data() %>%
filter(ADI == "ADI")
Non_Impact_BI <- BI_sd$data() %>%
filter(ADI == "Non_ADI")
# Total Impact v Non
Total_Impact_Apps <- nrow(Impact_Apps)
Total_NonImpact_Apps <- nrow(Non_Impact_Apps)
Total_Impact_Lic <- nrow(Impact_Lic)
Total_NonImpact_Lic <- nrow(Non_Impact_Lic)
Total_Impact_AE <- nrow(Impact_AE)
Total_NonImpact_AE <- nrow(Non_Impact_AE)
Total_Impact_BI <- nrow(Impact_BI)
Total_NonImpact_BI <- nrow(Non_Impact_BI)
# Impact
Impact_App_Approved <- Impact_Apps %>%
filter(Application_Status == "Approved")
Impact_App_EE <- Impact_Apps %>%
filter(Priority_Status == "Economic Empowerment")
Impact_App_DBE <- Impact_Apps %>%
filter(DBE_Category != "Not_DBE")
Impact_Lic_Approved <- Impact_Lic %>%
filter(License_Status == "Final License")
Impact_Lic_EE <- Impact_Lic %>%
filter(Priority_Status == "Economic Empowerment")
Impact_Lic_DBE <- Impact_Lic %>%
filter(DBE_Category != "Not_DBE")
Impact_AE_Approved <- Impact_AE %>%
filter(License_Status == "Final License")
Impact_AE_EE <- Impact_AE %>%
filter(Priority_Status == "Economic Empowerment")
Impact_AE_DBE <- Impact_AE %>%
filter(DBE_Category != "Not_DBE")
Impact_BI_Approved <- Impact_BI %>%
filter(License_Status == "Final License")
Impact_BI_EE <- Impact_BI %>%
filter(Priority_Status == "Economic Empowerment")
Impact_BI_DBE <- Impact_BI %>%
filter(DBE_Category != "Not_DBE")
Total_Impact_App_Approved <- nrow(Impact_App_Approved)
Total_Impact_App_EE <- nrow(Impact_App_EE)
Total_Impact_App_DBE <- nrow(Impact_App_DBE)
Total_Impact_Lic_Approved <- nrow(Impact_Lic_Approved)
Total_Impact_Lic_EE <- nrow(Impact_Lic_EE)
Total_Impact_Lic_DBE <- nrow(Impact_Lic_DBE)
Total_Impact_AE_Approved <- nrow(Impact_AE_Approved)
Total_Impact_AE_EE <- nrow(Impact_AE_EE)
Total_Impact_AE_DBE <- nrow(Impact_AE_DBE)
Total_Impact_BI_Approved <- nrow(Impact_BI_Approved)
Total_Impact_BI_EE <- nrow(Impact_BI_EE)
Total_Impact_BI_DBE <- nrow(Impact_BI_DBE)
# Non Impact
NonImpact_App_Approved <- Non_Impact_Apps %>%
filter(Application_Status == "Approved")
NonImpact_App_EE <- Non_Impact_Apps %>%
filter(Priority_Status == "Economic Empowerment")
NonImpact_App_DBE <- Non_Impact_Apps %>%
filter(DBE_Category != "Not_DBE")
NonImpact_Lic_Approved <- Non_Impact_Lic %>%
filter(License_Status == "Final License")
NonImpact_Lic_EE <- Non_Impact_Lic %>%
filter(Priority_Status == "Economic Empowerment")
NonImpact_Lic_DBE <- Non_Impact_Lic %>%
filter(DBE_Category != "Not_DBE")
NonImpact_AE_Approved <- Non_Impact_AE %>%
filter(License_Status == "Final License")
NonImpact_AE_EE <- Non_Impact_AE %>%
filter(Priority_Status == "Economic Empowerment")
NonImpact_AE_DBE <- Non_Impact_AE %>%
filter(DBE_Category != "Not_DBE")
NonImpact_BI_Approved <- Non_Impact_BI %>%
filter(License_Status == "Final License")
NonImpact_BI_EE <- Non_Impact_BI %>%
filter(Priority_Status == "Economic Empowerment")
NonImpact_BI_DBE <- Non_Impact_BI %>%
filter(DBE_Category != "Not_DBE")
Total_NonImpact_App_Approved <- nrow(NonImpact_App_Approved)
Total_NonImpact_App_EE <- nrow(NonImpact_App_EE)
Total_NonImpact_App_DBE <- nrow(NonImpact_App_DBE)
Total_NonImpact_Lic_Approved <- nrow(NonImpact_Lic_Approved)
Total_NonImpact_Lic_EE <- nrow(NonImpact_Lic_EE)
Total_NonImpact_Lic_DBE <- nrow(NonImpact_Lic_DBE)
Total_NonImpact_AE_Approved <- nrow(NonImpact_AE_Approved)
Total_NonImpact_AE_EE <- nrow(NonImpact_AE_EE)
Total_NonImpact_AE_DBE <- nrow(NonImpact_AE_DBE)
Total_NonImpact_BI_Approved <- nrow(NonImpact_BI_Approved)
Total_NonImpact_BI_EE <- nrow(NonImpact_BI_EE)
Total_NonImpact_BI_DBE <- nrow(NonImpact_BI_DBE)
```
ADI {data-navmenu="Intro" data-icon="fa-cannabis"}
=====================================
> A Geospatial Equity Analysis of the Massachusetts Cannabis Control Commission on Areas of Disproportionate Impact (ADI)
Column {data-width=300}
-----------------------------------------------------------------------
### Geospatial Analysis
Despite provisions in the law requiring the Massachusetts Cannabis Control Commission (MCCC) to ensure that people from communities disproportionately harmed by “The War on Drugs” were included in the new legal industry, the progress on implementing a variety of programs to actively engage people from communities of disproportionate impact has been mute. There are numerous avenues and several license types available in this emerging billion dollar industry, yet when looking at the demographics of who is being approved for these license **88%** have been issued to white men, only **4%** of Final Licenses include ownership from Disadvantaged Business Enterprise (DBE)
We now have the opportunity to redress the historic harm done to those specific individuals and communities by leveraging novel data sets to track Equity Involvement in the MA Cannabis industry. This dashboard leverages [MCCC Data](https://opendata.mass-cannabis-control.com) to display the geospatial distribution of the MCCC effectiveness in implementing equity provisions that not only translate into full inclusive participation by those disproportionately harmed.
Row {data-width=400}
-----------------------------------------------------------------------
### Areas of Disproportionate Impact (ADI)
The MCCC has identitifed 29 Areas of Disproportionate Impact throughout the Commonwealth
INSERT SUMMARY TABLE HERE
```{r}
# Insert summary table
```
Row {data-width=300}
-----------------------------------------------------------------------
### Industry Equity
The Commission is charged by state law (St. 2017, ch.55) with ensuring the meaningful participation in the cannabis industry of communities disproportionately affected by the enforcement of previous cannabis laws, small businesses, and companies led by people of color , women , veterans , and farmers . Broadly, the Commission refers to these statutory mandates as its efforts to create an equitable industry . If there is evidence of discrimination or barriers to entry in the regulated marijuana industry, state law directs the Commission to take remedial measures to address those hurdles.
Dashboards {data-orientation=columns data-navmenu="Intro" data-icon="fa-cannabis"}
=====================================
* The **left column** serves as the navigation bar. There are **2** tabs that have different filters for the basemap *ADI* & the location points of *Applications* , *Licenses* , & *Authority*
* The **middle column** includes **3** tabs for an *Interactive Map*, *Data Table* and *Equity Gauges* that respond to the navigation bar filters.
* The **right column** includes several tabs that display individual chart data based on the selected linked filters (look for matching icons)
Column {data-orientation=column data-width=275 .colored}
-----------------------------------------------------------------------
### Interactive Filters
The **ADI Filters Tab** contols the basemap variables that highlight which **Towns** meet the filtered data.
NOTE: The basemap variables are all linked, so filters remain on the basemap when the navigating between pages.
**ADI Filters Tab**
* [Impact](https://mass-cannabis-control.com/wp-content/uploads/2018/04/05.13.20_Guidance_Identifying_Areas_of_Disproportionate_Impact.pdf)
+ Yes
+ No
* [Adult Use Status](https://mass-cannabis-control.com/municipaltracker/)
+ Ban in place
+ Partial Ban
+ Retail Ban
+ Delivery Ban
+ Planning
+ No Zoning in Place
+ Zoning in Place
+ License Cap
+ Retail Cap
+ No Response
* [Delivery](https://mass-cannabis-control.com/municipaltracker/)
+ Ban in place
+ Litigation Pending
+ No Zoning in Place
+ Delivery Ban
+ Planning
+ No Zoning in Place
+ Zoning in Place
+ License Cap
+ Retail Cap
* [Social Consumption Status](https://mass-cannabis-control.com/municipaltracker/)
+ No
* [Marijuana Arrest Ranking](https://mass-cannabis-control.com/wp-content/uploads/2018/01/010918CNB-Impact-Arrests-Largest-Cities-MA.pdf)
* [Marijuana Possession Arrest Ranking](https://mass-cannabis-control.com/wp-content/uploads/2018/01/010918CNB-Impact-Arrests-Largest-Cities-MA.pdf)
* [Marijuana Sales Arrest Ranking](https://mass-cannabis-control.com/wp-content/uploads/2018/01/010918CNB-Impact-Arrests-Largest-Cities-MA.pdf)
The other tab(s) is used to filter the location points. These are the variables that highlight the *Applications* , *Licenses* , & *Authority*
**Filters Tab**
* Town
* County
* Application Status
+ Approved
+ Pending
* License Status
+ Final License
+ Provisional Consideration
+ Provisional License
* Priority Status
+ Economic Empowerment
+ General Applicant
+ RMD Priority
* License Type
+ Cooperative
+ Cultivator
+ Laboratory
+ Microbusiness
+ Product Manufacturer
+ Research Facility
+ Retailer
+ Transporter
* Disadvantaged Business Enterprise (DBE)
+ Disability
+ LGBTQI
+ Minority
+ Veteran
+ Woman
* Role
+ Ancillary
+ Domestic LLC
+ Holding Company
+ Investor
+ Management Company
+ Medical
+ Out of Country
+ Owner|Partner
+ Parent Company
* Business Name
* % Ownership
* % Control
* Total Applications
* Total Licenses
* Total Authority Agents
Row {data-width=525 .colored}
-----------------------------------------------------------------------
### Interactive Map
There are several *Feature* layers that can be selected to display filtered data on the interactive map. Every location point can be **clicked** on to popup the data related to the variable.
Select either a dark or grey basemap.
* **Basemaps**
+ *Dark basemap*
+ *Grey basemap*
Must feature to display data from navigation bar filters
* **Features**
+ *ADI* Highlights Towns based on ADI filters
+ *Application* Plots location based on Application filters
+ *Licenses* Plots location based on Licenses filters
+ *Entities* Plots location based on Entities filters
+ *Travel Entities* Plots connection to Authority Entities
+ *Interests* Plots location based on Interests filters
+ *Travel Interests* Plots connection to Business Interests
### Interactive Data
Displays a *Data Table* that respond to filters selected from the navigation bar. All of the *Data Tables* are interactive & can be searched indepedently, or in conjucton with the filters for the *Applications*, *Licenses* , & *Authority* -- Multiple rows can be selected that will highlight the data corresponding on the *Interactive Map*
* **Data Tab**
* Applications/Licenses
+ *Search* data to select & highlight location points on the *Interactive Map*
+ *Column visibility* the columns you wish to see/export
+ *Export* selected data as a CSV or Excel
* Entities/Interests
+ *Search* data to select & highlight location points on the *Interactive Map*
+ *Expand* display informaiton about the Authority location point
### Interactive Equity
The *Equity Gauges* are summary totals of ADI vs Non-ADI
**Equity Tab**
* *ADI* vs *Non ADI*
+ *Total Applications*
+ *Approved Applications*
+ *Total Licenses*
+ *Final Licenses*
+ *Economic Empowerment*
+ *DBE*
Row {data-width=250 .colored}
-----------------------------------------------------------------------
### Interactive Charts
Displays a *Pie Chart* that responds to the **Applications Filters Tab**, **Licenses Filters Tab**, **Authority Filters Tabs**
* **Chart Tabs**
+ *Total Applications*
+ *Application Status*
+ *Priority Status*
+ *License Status*
+ *License Type*
+ *DBE Category*
+ *Town*
+ *County*
Applications {data-icon="fa-cannabis"}
=====================================
Column {data-width=200 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### ADI
```{r adi filter}
filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C)
```
```{r aus filter}
filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S)
```
```{r delivery filter}
filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A)
```
```{r social consumption filter}
filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P)
```
```{r}
filter_slider("Mrjn_Arr_1", "Marijuana Arrest Ranking", ADI_sd_df, ~Mrjn_Arr_1)
```
```{r}
filter_slider("M_P_R", "Marijuana Possession Arrest Ranking", ADI_sd_df, ~M_P_R)
```
```{r}
filter_slider("M_S_R", "Marijuana Sales Arrest Ranking", ADI_sd_df, ~M_S_R)
```
### Applications
```{r app town filter}
filter_select("Business_Town", "Select Town", App_sd, ~Business_Town)
```
```{r app county filter}
filter_select("Business_County", "Select a County", App_sd, ~Business_County)
```
```{r app applicatin status filter}
filter_checkbox("Application_Status", "Application Status", App_sd, ~Application_Status, allLevels = TRUE)
```
```{r app prioirty status filter}
filter_checkbox("Priority_Status", "Priority Status", App_sd, ~Priority_Status, allLevels = TRUE)
```
```{r app license type filter}
filter_select("License_Type","License Type", App_sd, ~License_Type)
```
```{r app total applications fitler}
filter_slider("Total_Apps", "Total Applications", App_sd, ~Total_Apps, step = 1)
```
```{r app dbe category filter}
filter_select("DBE_Category","DBE Category", App_sd, ~DBE_Category)
```
```{r app business name filter}
filter_select("Business_Name","Search Business Name ", App_sd, ~Business_Name)
```
Column {data-width=650 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### Map
```{r app map}
appPSpal <- colorFactor(palette = c("#2ca02c", "#bcbd22"), App_sd$Application_Status, na.color = "#808080", alpha = TRUE)
leaflet() %>%
setView(-71.931180, 42.385453, zoom = 8) %>%
addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>%
addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>%
addPolygons(data = ADI_sd,
weight = .4,
smoothFactor = 1,
fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = .5, no = 0),
color = "#878787",
fillColor = "#17b502",
label = ~Town_1, # name as a hover label
group = "ADI") %>%
addCircleMarkers(data = App_sd,
lng = ~longitude,
lat = ~latitude,
popup = ~Appboxinfo,
fillOpacity = ifelse(test = App_sd$data()$Priority_Status == "Economic Empowerment", yes = 1, no = 0),
fillColor = "red",
color = ~appPSpal(Application_Status),
radius = App_sd$data()$Total_Apps*2.5,
group = "Applications") %>%
addLegend("bottomleft",
pal = appPSpal,
values = App_sd$data()$Application_Status,
title = "Applications Status",
opacity = 1) %>%
addLayersControl(overlayGroups = c("ADI","Applications"),
baseGroups = c("Dark","Grey", "Applications"),
options = layersControlOptions(collapsed = FALSE)) %>%
addMeasure()
```
### Data
```{r app data table}
datatable(App_sd, extensions= c('Buttons', "Scroller"),
class="compact", width="100%", rownames = FALSE,
options=list(
dom = 'Blfrtip',
deferRender=TRUE,
scrollY=300,
scroller=TRUE,
columnDefs = list(list(visible=FALSE, targets=c(8,9))),
buttons = list(I('colvis'), 'csv', 'excel')))
```
### Equity
**ADI** vs **Non ADI**
```{r app guage adi }
bscols(
div(
div(gauge(round(100*(Total_Impact_Apps/Total_Apps)), min = 0, max = 100, symbol = '%',
label = "Total Apps", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))),
div(gauge(Total_Impact_App_Approved, min = 0, max = Total_Impact_Apps,
label = "Approved", gaugeSectors(success = c(240, 251), warning = c(117, 239), danger = c(0, 115)
))),
div(gauge(Total_Impact_App_EE, min = 0, max = Total_Impact_Apps,
label = "Economic Empowerment", gaugeSectors(success = c(240, 251), warning = c(131, 239), danger = c(0, 130)
))),
div(gauge(round(100*(Total_Impact_App_DBE/Total_Impact_Apps)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
),
div(
div(gauge(round(100*(Total_NonImpact_Apps/Total_Apps)), min = 0, max = 100, symbol = '%',
label = "Total Apps", gaugeSectors(success = c(60, 100), warning = c(40, 59), danger = c(0, 39)
))),
div(gauge(Total_NonImpact_App_Approved, min = 0, max = Total_NonImpact_Apps,
label = "Approved", gaugeSectors(success = c(250, 523), warning = c(201, 249), danger = c(0, 200)
))),
div(gauge(Total_NonImpact_App_EE, min = 0, max = Total_NonImpact_Apps,
label = "Economic Empowerment", gaugeSectors(success = c(401, 523), warning = c(250, 400), danger = c(0, 250)
))),
div(gauge(round(100*(Total_NonImpact_App_DBE/Total_NonImpact_Apps)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
)
)
```
Column {data-width=350 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
###
```{r}
plot_ly(App_sd,
labels = ~ Application_Status,
values = ~ Total_Apps,
type = 'pie',
marker = list(colors = c('#bcbd22', '#2ca02c')),
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Application Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r app priority status pie}
plot_ly(App_sd,
labels = ~ Priority_Status,
values = ~ Total_Apps,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Priority Status",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r app lic type dbe pie}
plot_ly(App_sd,
labels = ~ License_Type,
values = ~ Total_Apps,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "License Type",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r}
plot_ly(App_sd,
labels = ~ DBE_Category,
values = ~ Total_Apps,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "DBE Category",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r app town county pie}
plot_ly(App_sd,
labels = ~ Business_Town,
values = ~ Total_Apps,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Total Applications by Town",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r}
plot_ly(App_sd,
labels = ~ Business_County,
values = ~ Total_Apps,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Total Applications by County",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
Licenses {data-icon="fa-cannabis"}
=====================================
Column {data-width=200 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### ADI
```{r lic adi filter}
filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C)
```
```{r lic aus filter}
filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S)
```
```{r lic delivery filter}
filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A)
```
```{r lic social consumption filter}
filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P)
```
```{r}
filter_slider("Mrjn_Arr_1", "Marijuana Arrest Ranking", ADI_sd_df, ~Mrjn_Arr_1)
```
```{r}
filter_slider("M_P_R", "Marijuana Possession Arrest Ranking", ADI_sd_df, ~M_P_R)
```
```{r}
filter_slider("M_S_R", "Marijuana Sales Arrest Ranking", ADI_sd_df, ~M_S_R)
```
### License
```{r lic town filter}
filter_select("Business_Town", "Select Town", Lic_sd, ~Business_Town)
```
```{r lic county filter}
filter_select("Business_County", "Select a County", Lic_sd, ~Business_County)
```
```{r lic prioirty status filter}
filter_checkbox("Priority_Status", "Prioirty Status", Lic_sd, ~Priority_Status, allLevels = TRUE)
```
```{r lic status filter}
filter_checkbox("License_Status", "License Status", Lic_sd, ~License_Status, allLevels = TRUE)
```
```{r lic license type filter}
filter_select("License_Type","License Type", Lic_sd, ~License_Type)
```
```{r lic total licenses fitler}
filter_slider("Total_Licenses", "Total Licenses", Lic_sd, ~Total_Licenses, step = 1)
```
```{r lic dbe category filter}
filter_select("DBE_Category","DBE Category", Lic_sd, ~DBE_Category)
```
```{r lic business name filter}
filter_select("Business_Name","Search Business Name ", Lic_sd, ~Business_Name)
```
Column {data-width=650 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### Map
```{r lic map}
LicPSpal <- colorFactor(palette = c("#2ca02c", "#bcbd22", "#1f77b4"), Lic_sd$License_Status, na.color = "#808080", alpha = TRUE)
leaflet() %>%
setView(-71.931180, 42.385453, zoom = 8) %>%
addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>%
addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>%
addPolygons(data = ADI_sd,
weight = .4,
smoothFactor = 1,
fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = .5, no = 0),
color = "#878787",
fillColor = "#17b502",
label = ~Town_1, # name as a hover label
group = "ADI") %>%
addCircleMarkers(data = Lic_sd,
lng = ~Lon,
lat = ~Lat,
popup = ~Licboxinfo,
fillOpacity = ifelse(test = Lic_sd$data()$Priority_Status == "Economic Empowerment", yes = 1, no = 0),
fillColor = "red",
color = ~LicPSpal(License_Status),
radius = Lic_sd$data()$Total_Licenses*2.5,
group = "Licenses") %>%
addLegend("bottomleft",
pal = LicPSpal,
values = Lic_sd$data()$License_Status,
title = "License Status",
opacity = 1) %>%
addLayersControl(overlayGroups = c("ADI","Licenses"),
baseGroups = c("Dark","Grey", "Licenses"),
options = layersControlOptions(collapsed = FALSE)) %>%
addMeasure()
```
### Data
```{r lic data table}
datatable(Lic_sd, extensions= c('Buttons', "Scroller"),
class="compact", width="100%", rownames = FALSE,
options=list(
dom = 'Blfrtip',
deferRender=TRUE,
scrollY=300,
scroller=TRUE,
columnDefs = list(list(visible=FALSE, targets=c(8,9))),
buttons = list(I('colvis'), 'csv', 'excel')))
```
### Equity
**ADI** vs **Non ADI**
```{r lic guages }
bscols(
div(
div(gauge(round(100*(Total_Impact_Lic/Total_Lic)), min = 0, max = 100, symbol = '%',
label = "Total Licenses", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))),
div(gauge(Total_Impact_Lic_Approved, min = 0, max = Total_Impact_Lic,
label = "Approved", gaugeSectors(success = c(240, 251), warning = c(117, 239), danger = c(0, 115)
))),
div(gauge(Total_Impact_Lic_EE, min = 0, max = Total_Impact_Lic,
label = "Economic Empowerment", gaugeSectors(success = c(240, 251), warning = c(131, 239), danger = c(0, 130)
))),
div(gauge(round(100*(Total_Impact_Lic_DBE/Total_Impact_Lic)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
),
div(
div(gauge(round(100*(Total_NonImpact_Lic/Total_Lic)), min = 0, max = 100, symbol = '%',
label = "Total Licenses", gaugeSectors(success = c(60, 100), warning = c(40, 59), danger = c(0, 39)
))),
div(gauge(Total_NonImpact_Lic_Approved, min = 0, max = Total_NonImpact_Lic,
label = "Approved", gaugeSectors(success = c(250, 523), warning = c(201, 249), danger = c(0, 200)
))),
div(gauge(Total_NonImpact_Lic_EE, min = 0, max = Total_NonImpact_Lic,
label = "Economic Empowerment", gaugeSectors(success = c(401, 523), warning = c(250, 400), danger = c(0, 250)
))),
div(gauge(round(100*(Total_NonImpact_Lic_DBE/Total_NonImpact_Lic)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
)
)
```
Column {data-width=350 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
###
```{r lic status pie}
plot_ly(Lic_sd,
labels = ~License_Status,
values = ~ Total_Licenses,
type = 'pie',
marker = list(colors = c('#bcbd22', '#2ca02c')),
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "License Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r lic priority status pie}
plot_ly(Lic_sd,
labels = ~ Priority_Status,
values = ~ Total_Licenses,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Priority Status",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r lic lic type dbe pie}
plot_ly(Lic_sd,
labels = ~ License_Type,
values = ~ Total_Licenses,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "License Type",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r lic dbe pie}
plot_ly(Lic_sd,
labels = ~DBE_Category,
values = ~Total_Licenses,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "DBE Category",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r lic town pie}
plot_ly(Lic_sd,
labels = ~ Business_Town,
values = ~ Total_Licenses,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Total Licenses by Town",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
###
```{r lic county pie}
plot_ly(Lic_sd,
labels = ~Business_County,
values = ~Total_Licenses,
type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
showlegend=T) %>%
layout(title = "Total Licenses by County",legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
Authority {data-icon="fa-cannabis"}
=====================================
Column {data-width=200 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### ADI
```{r int ent adi filter}
filter_checkbox("Imp_C", "Area of Disproportionate Impact (ADI)", ADI_sd_df, ~Imp_C)
```
```{r int ent aus filter}
filter_select("A_U_S", "Adult Use Status", ADI_sd_df, ~A_U_S)
```
```{r int ent delivery filter}
filter_select("Dlv_A", "Delivery", ADI_sd_df,~Dlv_A)
```
```{r int ent social consumption filter}
filter_select("S_C_P", "Social Consumption", ADI_sd_df,~S_C_P)
```
### E.
```{r ent town filter}
filter_select("Business_Town", "Select Town", AE_sd, ~Business_Town)
```
```{r ent county filter}
filter_select("Business_County", "Select a County", AE_sd, ~Business_County)
```
```{r ent prioirty status filter}
filter_checkbox("Priority_Status", "Prioirty Status", AE_sd, ~Priority_Status, allLevels = TRUE)
```
```{r ent status filter}
filter_checkbox("License_Status", "License Status", AE_sd, ~License_Status, allLevels = TRUE)
```
```{r ent license type filter}
filter_select("License_Type","License Type", AE_sd, ~License_Type)
```
```{r ent total authority fitler}
filter_slider("Total_Authority_Agents", "Total Authority Agents", AE_sd, ~Total_Authority_Agents, step = 5)
```
```{r ent dbe category filter}
filter_select("DBE_Category","DBE Category", AE_sd, ~DBE_Category)
```
```{r ent role filter}
filter_select("Role", "Role", AE_sd, ~Role)
```
```{r ent ownership filter}
filter_slider("Ownership", "% Ownership", AE_sd, ~Ownership, step = 10)
```
```{r ent control filter}
filter_slider("Control", "% Controls", AE_sd, ~Control, step = 10)
```
```{r ent business name filter}
filter_select("Business_Name","Business Name", AE_sd, ~Business_Name)
```
### I.
```{r int town filter}
filter_select("Business_Town", "Select Town", BI_sd, ~Business_Town)
```
```{r int county filter}
filter_select("Business_County", "Select a County", BI_sd, ~Business_County)
```
```{r int prioirty status filter}
filter_checkbox("Priority_Status", "Prioirty Status", BI_sd, ~Priority_Status, allLevels = TRUE)
```
```{r int status filter}
filter_checkbox("License_Status", "License Status", BI_sd, ~License_Status, allLevels = TRUE)
```
```{r int license type filter}
filter_select("License_Type","License Type", BI_sd, ~License_Type)
```
```{r int total authority fitler}
filter_slider("Total_Authority_Agents", "Total Authority Agents", BI_sd, ~Total_Authority_Agents, step = 5)
```
```{r int dbe category filter}
filter_select("DBE_Category","DBE Category", BI_sd, ~DBE_Category)
```
```{r int role filter}
filter_select("Role", "Role", BI_sd, ~Role)
```
```{r int business name filter}
filter_select("Business_Name","Business Name", BI_sd, ~Business_Name)
```
Column {data-width=650 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### Map
```{r ent int map}
AEPSpal <- colorFactor(palette = 'Spectral', levels=AE_sd$data()$Role, ordered=FALSE)
leaflet() %>%
setView(-71.931180, 42.385453, zoom = 8) %>%
addProviderTiles("CartoDB.DarkMatter", group = "Dark") %>%
addProviderTiles("Esri.WorldGrayCanvas", group = "Grey") %>%
addPolygons(data = ADI_sd,
weight = .4,
smoothFactor = 1,
fillOpacity = ifelse(test = ADI_sd$Imp_C == "Impact", yes = 0.5, no = 0),
color = "#878787",
fillColor = "#17b502",
label = ~Town_1, # name as a hover label
group = "ADI") %>%
addCircleMarkers(data = AE_sd,
lng = ~Lon,
lat = ~Lat,
popup = ~AutAboxinfo,
color = ~AEPSpal(Role),
radius = ~AE_sd$data()$Total_Authority_Agents/3,
group = "Entities") %>%
addCircleMarkers(data = BI_sd,
lng = ~Lon,
lat = ~Lat,
popup = ~BIboxinfo,
color = ~AEPSpal(Role),
radius = ~BI_sd$data()$Total_Authority_Agents/10,
group = "Interests") %>%
addPolylines(data = flows_sd,
weight = flows_sd$data()$Ownership/10,
label = hover,
group = "Travel Interests",
color="#00b3ff") %>%
addPolylines(data = flows_sd,
weight = flows_sd$data()$Total_Authority_Agents/10,
label = hover,
group = "Travel Entities",
color="#00b3ff") %>%
addCircleMarkers(Geolines$end.latitude,
Geolines$end.longitude,
color="orange",
radius=Geolines$ownership/15,
group= "Travel Points") %>%
addCircleMarkers(Geolines$start.latitude,
Geolines$start.longitude,
color="orange",
radius=Geolines$control/15,
group = "Travel Points") %>%
addLegend("bottomleft",
pal = AEPSpal,
values = AE_sd$data()$Role,
title = "Authority Role",
opacity = 1) %>%
addLayersControl(overlayGroups = c("ADI","Entities", "Interests","Travel Points", "Travel Interests", "Travel Entities"),
baseGroups = c("Dark","Grey"),
options = layersControlOptions(collapsed = FALSE)) %>%
addMeasure()
```
### E. Data
```{r ent data table}
DT::datatable(AE_sd, rownames = FALSE, class = 'cell-border stripe' ,
extensions = c('ColReorder','Responsive'), options = list(colReorder = TRUE))
```
### I.Data
```{r int data table}
DT::datatable(BI_sd, rownames = FALSE, class = 'cell-border stripe' ,
extensions = c('ColReorder','Responsive'), options = list(colReorder = TRUE))
```
### E. Equity
**ADI** vs **Non ADI**
```{r ent guages }
bscols(
div(
div(gauge(round(100*(Total_Impact_AE/Total_AE)), min = 0, max = 100, symbol = '%',
label = "Entities", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))),
div(gauge(Total_Impact_AE_Approved, min = 0, max = Total_Impact_AE,
label = "License", gaugeSectors(success = c(240, 251), warning = c(117, 239), danger = c(0, 115)
))),
div(gauge(Total_Impact_AE_EE, min = 0, max = Total_Impact_AE,
label = "Economic Empowerment", gaugeSectors(success = c(240, 251), warning = c(131, 239), danger = c(0, 130)
))),
div(gauge(round(100*(Total_Impact_AE_DBE/Total_Impact_AE)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
),
div(
div(gauge(round(100*(Total_NonImpact_AE/Total_AE)), min = 0, max = 100, symbol = '%',
label = "Entities", gaugeSectors(success = c(60, 100), warning = c(40, 59), danger = c(0, 39)
))),
div(gauge(Total_NonImpact_AE_Approved, min = 0, max = Total_NonImpact_AE,
label = "License", gaugeSectors(success = c(250, 523), warning = c(201, 249), danger = c(0, 200)
))),
div(gauge(Total_NonImpact_AE_EE, min = 0, max = Total_NonImpact_AE,
label = "Economic Empowerment", gaugeSectors(success = c(401, 523), warning = c(250, 400), danger = c(0, 250)
))),
div(gauge(round(100*(Total_NonImpact_AE_DBE/Total_NonImpact_AE)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
)
)
```
### I. Equity
**ADI** vs **Non ADI**
```{r int guages }
bscols(
div(
div(gauge(round(100*(Total_Impact_BI/Total_BI)), min = 0, max = 100, symbol = '%',
label = "Interests", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))),
div(gauge(Total_Impact_BI_Approved, min = 0, max = Total_Impact_BI,
label = "Licenses", gaugeSectors(success = c(240, 251), warning = c(117, 239), danger = c(0, 115)
))),
div(gauge(Total_Impact_BI_EE, min = 0, max = Total_Impact_BI,
label = "Economic Empowerment", gaugeSectors(success = c(240, 251), warning = c(131, 239), danger = c(0, 130)
))),
div(gauge(round(100*(Total_Impact_BI_DBE/Total_Impact_BI)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
),
div(
div(gauge(round(100*(Total_NonImpact_BI/Total_BI)), min = 0, max = 100, symbol = '%',
label = "Interests", gaugeSectors(success = c(60, 100), warning = c(40, 59), danger = c(0, 39)
))),
div(gauge(Total_NonImpact_BI_Approved, min = 0, max = Total_NonImpact_BI,
label = "Licenses", gaugeSectors(success = c(40, 56), warning = c(201, 249), danger = c(0, 200)
))),
div(gauge(Total_NonImpact_BI_EE, min = 0, max = Total_NonImpact_BI,
label = "Economic Empowerment", gaugeSectors(success = c(401, 523), warning = c(250, 400), danger = c(0, 250)
))),
div(gauge(round(100*(Total_NonImpact_BI_DBE/Total_NonImpact_BI)), min = 0, max = 100, symbol = '%',
label = "DBE", gaugeSectors(success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
)))
)
)
```
Column {data-width=350 .tabset .tabset-fade .colored}
-----------------------------------------------------------------------
### E.
```{r ent lic status pie}
plot_ly(AE_sd, labels = ~ License_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "License Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I.
```{r int lic status pie}
plot_ly(BI_sd, labels = ~ License_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "License Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### E.
```{r ent lic priority status pie}
plot_ly(AE_sd, labels = ~ Priority_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "Priority Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I.
```{r int lic priority status pie}
plot_ly(BI_sd, labels = ~ Priority_Status, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "Priority Status", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### E.
```{r ent int lic license type pie}
plot_ly(AE_sd, labels = ~ License_Type, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "License Type", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I.
```{r}
plot_ly(BI_sd, labels = ~ License_Type, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "License Type", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### E.
```{r ent int lic dbe category pie}
plot_ly(AE_sd, labels = ~ DBE_Category, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "DBE Category", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I.
```{r}
plot_ly(BI_sd, labels = ~ DBE_Category, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "DBE Category", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### E. Town
```{r}
plot_ly(AE_sd, labels = ~ Business_Town, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "Town Entity Agents", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I. Town
```{r}
plot_ly(BI_sd, labels = ~ Business_Town, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "Town Interest Agents", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### E. County
```{r}
plot_ly(AE_sd, labels = ~ Business_County, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "County Entity Agents", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```
### I. County
```{r}
plot_ly(BI_sd, labels = ~ Business_County, values = ~ Total_Authority_Agents, type = 'pie', textposition = 'inside', textinfo = 'label+percent', showlegend=T) %>% layout(title = "County Interest Agents", legend = list(orientation ="h", xanchor = "center", x = 0.5, y = -0.1))
```