From 27d2fc9131cd73df19fbac3909b71d97fabd86ec Mon Sep 17 00:00:00 2001
From: jwucouncil <61881283+jwucouncil@users.noreply.github.com>
Date: Wed, 17 Apr 2024 16:29:20 -0400
Subject: [PATCH 1/3] map change for 10k
---
code/02_mapping.R | 25 +++++++++++-------
...tal-health-services-landscape-english.xlsx | Bin 165 -> 0 bytes
visuals/sbhc_map.html | 6 ++---
3 files changed, 19 insertions(+), 12 deletions(-)
delete mode 100644 data/input/~$mental-health-services-landscape-english.xlsx
diff --git a/code/02_mapping.R b/code/02_mapping.R
index 6c60eb0..e3f1b9d 100644
--- a/code/02_mapping.R
+++ b/code/02_mapping.R
@@ -5,10 +5,13 @@ source('code/00_load_dependencies.R')
### Map Labels and chloropeth colors
#####
# Base layer - Total Enrollment
+school_dist_shp$sbhc10k <- school_dist_shp$num_sbhc/(school_dist_shp$total_enrollment/10000)
+
map_total_enrollment_popup <- paste('',"School District:",school_dist_shp$school_dis,"
",
- "","Total Open Schools:",prettyNum(school_dist_shp$num_open_schools, big.mark = ','),"
",
+ "","Number of SBHCs per 10k Students: ",round(school_dist_shp$sbhc10k,2),"
",
+ "","Total Schools:",prettyNum(school_dist_shp$num_open_schools, big.mark = ','),"
",
"","Total Enrolled Students:",prettyNum(school_dist_shp$total_enrollment, big.mark = ','),"
",
- "","Number of Open SBHC:",prettyNum(school_dist_shp$num_sbhc, big.mark = ','),"
",
+ "","Number of SBHC:",prettyNum(school_dist_shp$num_sbhc, big.mark = ','),"
",
"","Number Schools SBHC Served:",prettyNum(school_dist_shp$num_sbhc_schools_served, big.mark = ','),"
",
"","Number of Schools SMHC Served:",prettyNum(school_dist_shp$num_schools_smhc_served, big.mark = ','),"
",
"
",
@@ -17,11 +20,11 @@ map_total_enrollment_popup <- paste('',"School Distr
"","Percent of Students with Diabetes 1:",label_percent(accuracy = 0.01)(school_dist_shp$percent_diabetes1),"
",
"","Percent of Students with Diabetes 2:",label_percent(accuracy = 0.01)(school_dist_shp$percent_diabetes2),"
")
-enrollment_cuts <- classIntervals(var = school_dist_shp$total_enrollment,n=3)
+enrollment_cuts <- classIntervals(var = school_dist_shp$sbhc10k,n=3)
enrollment_pal = councildown::colorBin(
palette = "bw",
bins = enrollment_cuts$brks,
- domain = school_dist_shp$total_enrollment,
+ domain = school_dist_shp$sbhc10k,
na.color = "#FFFFFF"
)
@@ -183,9 +186,9 @@ m <- leaflet() %>%
`font-weight` = "bold"))) %>%
#addTiles() %>%
# Overlay Groups
- # Default Base Layer - total enrollment
+ # Default Base Layer - sbhc per 10k enrollment
addPolygons(data = school_dist_shp,
- fillColor = ~enrollment_pal(total_enrollment),
+ fillColor = ~enrollment_pal(sbhc10k),
fillOpacity = 0.5,
color = "black",
opacity = 1,
@@ -348,7 +351,7 @@ m <- leaflet() %>%
addLegend(pal = enrollment_pal,
values = school_dist_shp$total_enrollment,
labFormat = labelFormat(digits = 0, big.mark = ","),
- title = "Total Enrollment in SD",
+ title = "SBHCs per 10k Students in SD",
layerId = "enrollment") %>%
addLegend(pal = poverty_pal,
values = school_dist_shp$percent_poverty,
@@ -412,7 +415,7 @@ school_dist_shp %>%
# ENROLLMENT
# The top 3 largest school districts are 31, 2, and 24 with 61,838, 57,900, 54,197 people enrolled respectively.
# Of these, only district 24 has a poverty percentage of greater than 70% and the other 2 has less than 60% in poverty.
-# District 2 has the largest number of open schools of all districts and has 8 SBHCs serving 34 schools. District 31 and 24
+# District 2 has the largest number of open schools of all districts and has 8 SBHCs serving 34 schools out of 133. District 31 and 24
# have 4 and 2 SBHCs respectively, both serving only 7 schools out of 87 and 69 respectively.
school_dist_shp %>%
@@ -440,6 +443,10 @@ school_dist_shp %>%
lmtest = lm(num_sbhc~total_enrollment + num_open_schools + percent_poverty + percent_asthma, data = school_dist_shp) #Create the linear regression
summary(lmtest) #Review the results
-# MOST SBHC Traits?
+# Areas with highest density of SBHCs/10k students
+sbhcper10 <- school_dist_shp %>%
+ filter(sbhc10k >= 1.9985669)
+# Of the 11 districts with high densities of SBHCs per 10k students, only districts 15 and 3 have less than 78% students in poverty,
+# with 54% and 49% respectively. They also have the some of the lowest reported asthma rates when compared to the other 9 districts.
diff --git a/data/input/~$mental-health-services-landscape-english.xlsx b/data/input/~$mental-health-services-landscape-english.xlsx
deleted file mode 100644
index 5a932052db2a5d1e1d32a453f59be330b8becc3b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 165
zcmWgj%}g%JFV0UZQSeVo%S=vH2rW)6QXm9G8GIQs8Il=_81fm4fjEt!gh7G9A4sQx
R#Z!U2P@qgIP=x};5CA3W7%cz*
diff --git a/visuals/sbhc_map.html b/visuals/sbhc_map.html
index 432ff26..f40d6a0 100644
--- a/visuals/sbhc_map.html
+++ b/visuals/sbhc_map.html
@@ -4053,9 +4053,9 @@
-