How to Use: * Click on the “layers” icon to toggle on/off different layers on the chloropleth map. * Click the “tooth” icon to display more information about the dental office at that location. * Zoom in and out using “+” or “-” at the top left of map, or pressing and holding the “CNTRL” key and scrolling the wheel on your mouse up or down. Data Sources: * Population counts are per U.S. Census, 2010. * Dental office “locations” and “counts” are as per ND Department of Health, October, 2019. Updated on December 8, 2019
How to Use: * Click on the “layers” icon to toggle on/off different layers on the chloropleth map. * Click the “tooth” icon to display more information about the dental office at that location. * Zoom in and out using “+” or “-” at the top left of map, or pressing and holding the “CNTRL” key and scrolling the wheel on your mouse up or down. Data Sources: * Population counts are per U.S. Census, 2010. * Dental office “locations” and “counts” are as per ND Department of Health, October, 2019. Updated on December 8, 2019
How to Use: * Hover over the “circle” icon to display more information about the school and the type of dental sealant program provider at that school location. * Hover over map to highlight and display county information. * Zoom in and out using “+” or “-” at the top left of map, or pressing and holding the “CNTRL” key and scrolling the wheel on your mouse up or down. Data Sources: * Population counts are per U.S. Census, 2010. * Enrolled school “locations” and “counts” are as per ND Department of Health, October, 2019. Updated on December 8, 2019
---
title: "test 2 ND Oral Health Dashboard"
output:
flexdashboard::flex_dashboard:
storyboard: true
social: menu
source: embed
theme: bootstrap
logo: hdlogo.png
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(DT)
library(leaflet)
library(tidyverse)
library(ggplot2)
library(rgdal)
library("raster")
library("sp")
library("GISTools")
library("raster")
library("sp")
library("GISTools")
library(tidyverse)
library(sf)
library(units)
library(tmap)
library(htmlwidgets)
library(htmltools)
setwd("/Users/rashaelnimeiry/Desktop/Meetings ND/ND county DD NDGISHubData")
# cnty<-readOGR("NDHUB.COUNTIES_polygon.shp")
setwd("/Users/rashaelnimeiry/Desktop/Meetings ND")
cnty<-readOGR("cntyshpschlsUnique.shp")
#has counts of dental offices and schools dental sealant prog counts
daddn<-read.csv("daddn.csv")
daddn<-subset(daddn, officestate=="ND")
allschools<-read.csv("geoallschools.csv")
#
# cntyna <- c("Burke" , "Billings" ,"Bowman" ,"Ward" ,"Rolette" ,"Mountrail" ,"Richland" ,"Towner" ,
# "Ramsey" ,"Stutsman" ,"Oliver" ,"Sioux" ,"Adams" ,"Steele" ,"Barnes" ,"Hettinger" ,
# "Ransom" ,"Pembina" ,"Dickey" ,"Wells" ,"Benson" ,"Grand Forks" ,"McIntosh" ,
# "Logan" ,"Renville" ,"Pierce" ,"Foster" ,"Grant" ,"Golden Valley" ,"Divide" ,"Stark" ,
# "Nelson" ,"Sargent" ,"LaMoure" ,"Bottineau" ,"Cavalier" ,"Sheridan" ,"McHenry" ,
# "Traill" ,"Eddy" ,"Emmons" ,"Dunn" ,"Walsh" ,"Kidder" ,"Cass" ,"Mercer" ,"McLean" ,
# "McKenzie" ,"Burleigh" ,"Morton" ,"Slope" ,"Williams" ,"Griggs" )
# cnty@data<-cbind(cntyna, cnty@data)
icon<- makeIcon(
iconUrl = "https://cdn2.iconfinder.com/data/icons/human-body-parts/614/5008_-_Tooth-512.png",
iconWidth = 22, iconHeight = 21,
iconAnchorX = 0, iconAnchorY = 0)
pal<- colorNumeric(palette = c("#087482", "#796e66", "#faa21b", "#d34727", "#a8353a"), domain = cnty@data$POP2010, na.color="transparent")
mytext<-paste(
"","County Name: ","", cnty@data$cntyna,"
",
"","Population: ","", round(cnty@data$POP2010, 2),
sep = "") %>%
lapply(htmltools::HTML)
org <- "#d34727"
dgrey <- "#796e66"
lgrey <- "#b6b0a2"
turq <- "#087482"
blk <- "#000000"
burg <- "#a8353a"
byell <- "#faa21b"
bblue <- "#049fda"
dgrn <- "#709749"
lgrn <- "#b3bd35"
```
### North Dakota Dental Office Locations
```{r }
leaflet(cnty) %>%
setView(lng= -100.19, lat=47.53, zoom=7.5) %>%
addPolygons(data=cnty, color= dgrey, weight = 2, fillColor = org, fillOpacity = .1, opacity = .30,
highlightOptions = highlightOptions(color = turq, weight = 3.5, opacity = .6,
bringToFront = F),
label = mytext,
labelOptions = labelOptions(
style = list("font-weight" = "normal", padding = "3px"),
textsize = "13px",
direction = "auto" )) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addMarkers( icon= icon,
lng = daddn$lon,
lat = daddn$lat,
popup = paste("", "Office Name: ","", daddn$officename , "
" ,
"", "Specialty: ", "", daddn$specialtyada, "
",
"", "Practicing Status: ", "", daddn$Practicing, "
",
"", "Licensure: ", "", daddn$license),
group="Dental Office Locations") %>%
addPolygons( data=cnty ,
fillColor = ~pal(cnty@data$POP2010),
weight=0.9,
stroke=TRUE,
color=dgrey,
fillOpacity = 0.5,
label = mytext,
labelOptions = labelOptions(
style = list("font-weight" = "normal", padding = "3px 8px"),
textsize = "13px",
direction = "auto" ),
highlightOptions = highlightOptions(color = "white", weight = 4.5, opacity = .6,
bringToFront = T),
group="Population 2010") %>%
addLegend("topright",
pal = pal,
values=cnty@data$POP2010,
labels = ~pal,
title="North Dakota Population 2010",
opacity = .5,
group="Legend") %>%
addLayersControl(overlayGroups = c( "Dental Office Locations", "Population 2010", "Legend"))
```
***
How to Use:
* Click on the "layers" icon to toggle on/off different layers on the chloropleth map.
* Click the "tooth" icon to display more information about the dental office at that location.
* Zoom in and out using "+" or "-" at the top left of map, or pressing and holding the "CNTRL" key and scrolling the wheel on your mouse up or down.
Data Sources:
* Population counts are per U.S. Census, 2010.
* Dental office "locations" and "counts" are as per ND Department of Health, October, 2019.
Updated on December 8, 2019
### Table 1: Distribution of Dental Offices and Population by County
```{r}
DT::datatable(cnty@data[, c("NAME", "cntdntf", "POP2010", "POP10_S") ],
rownames = F, colnames= c("County" ,"Dental Offices per County", "Population", "Population per Sq. mi."), options = list(pageLength = 50, searchHighlight=TRUE, width="auto"))
```
How to Use:
* Click on the "layers" icon to toggle on/off different layers on the chloropleth map.
* Click the "tooth" icon to display more information about the dental office at that location.
* Zoom in and out using "+" or "-" at the top left of map, or pressing and holding the "CNTRL" key and scrolling the wheel on your mouse up or down.
Data Sources:
* Population counts are per U.S. Census, 2010.
* Dental office "locations" and "counts" are as per ND Department of Health, October, 2019.
Updated on December 8, 2019
### North Dakota School-Based Dental Sealant Program
```{r}
library(htmltools)
library(ggmap)
library(leaflet)
pal<- colorNumeric(palette = c("#087482", "#796e66", "#faa21b", "#d34727", "#a8353a"), domain = cnty@data$POP2010, na.color="transparent")
pal2<-colorFactor(palette =c(blk, turq, org, byell, "white"), domain=levels(allschools$Provider.Type))
cntyna <- c("Burke" , "Billings" ,"Bowman" ,"Ward" ,"Rolette" ,"Mountrail" ,"Richland" ,"Towner" ,
"Ramsey" ,"Stutsman" ,"Oliver" ,"Sioux" ,"Adams" ,"Steele" ,"Barnes" ,"Hettinger" ,
"Ransom" ,"Pembina" ,"Dickey" ,"Wells" ,"Benson" ,"Grand Forks" ,"McIntosh" ,
"Logan" ,"Renville" ,"Pierce" ,"Foster" ,"Grant" ,"Golden Valley" ,"Divide" ,"Stark" ,
"Nelson" ,"Sargent" ,"LaMoure" ,"Bottineau" ,"Cavalier" ,"Sheridan" ,"McHenry" ,
"Traill" ,"Eddy" ,"Emmons" ,"Dunn" ,"Walsh" ,"Kidder" ,"Cass" ,"Mercer" ,"McLean" ,
"McKenzie" ,"Burleigh" ,"Morton" ,"Slope" ,"Williams" ,"Griggs" )
cnty@data<-cbind(cntyna, cnty@data)
mytext<-paste(
"", "County Name: ","", cnty@data$cntyna,"
",
"","Population: ", "", round(cnty@data$POP2010, 2),
sep = "") %>%
lapply(htmltools::HTML)
leaflet(cnty) %>%
setView(lng= -100.19, lat=47.53, zoom=7.5) %>%
addPolygons(data=cnty,
fillColor = "grey",
weight=0.9,
smoothFactor = 1,
color="grey",
fillOpacity = 0.5,
highlightOptions = highlightOptions(color = turq, weight = 3.5, opacity = .6,
bringToFront = F),
label = mytext,
labelOptions = labelOptions(
style = list("font-weight" = "normal", padding = "3px 8px"),
textsize = "13px",
direction = "auto" )) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
addCircleMarkers(
radius=8.5,
weight=.9,
fillOpacity = .42,
lng = allschools$lon,
lat = allschools$lat,
color= ~pal2(allschools$Provider.Type),
label= lapply(paste("","School Name: ", "", allschools$Name.of.School , "
" ,
"","Provider: ","", allschools$Provider.Type, "
"), HTML) ,
group="School Locations") %>%
addLegend("topright",
pal = pal2,
values=allschools$Provider.Type,
labels = ~pal2,
title="North Dakota Schools Enrolled in Dental Sealant Programs by Provider Type",
group="Legend",
opacity = .5)
```
***
How to Use:
* Hover over the “circle” icon to display more information about the school and the type of dental sealant program provider at that school location.
* Hover over map to highlight and display county information.
* Zoom in and out using "+" or "-" at the top left of map, or pressing and holding the "CNTRL" key and scrolling the wheel on your mouse up or down.
Data Sources:
* Population counts are per U.S. Census, 2010.
* Enrolled school "locations" and "counts" are as per ND Department of Health, October, 2019.
Updated on December 8, 2019
### Table 2: Distribution of Enrolled Schools and Population by County
```{r}
DT::datatable(cnty@data[, c("NAME", "cntschl", "POP2010", "POP10_S") ],
rownames = F, colnames= c("County" ,"Schools Enrolled per County", "Population", "Population per Sq. mi."), options = list(pageLength = 53, searchHighlight=TRUE, width="auto"))
```