Skip to content

Commit

Permalink
visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
NYCC authored and NYCC committed Apr 16, 2024
1 parent 87d31d0 commit a556244
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 279 deletions.
11 changes: 7 additions & 4 deletions code/sbhc_aggregate_stats.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(gtExtras)
library(dplyr)
library(plotly)
library(htmlwidgets)
library(janitor)
Expand Down Expand Up @@ -40,15 +40,18 @@ sbhc_data <- map_sf %>%
sbhc_data[sbhc_data$building_code=="X161","total_enrolled"] <- 323
sbhc_data[sbhc_data$building_code=="X098","total_enrolled"] <- 113
sbhc_data[sbhc_data$building_code=="M506","total_enrolled"] <- 444
sbhc_data[sbhc_data$sbhc_sponsor=="East Harlem Council For Human Services/Boriken Neighborhood Health Center","sbhc_sponsor"] <- "East Harlem Council For Human Service"

# There are 18 sponsors - Montefiore medical center has the most sbhc and top 3 sponsors have 50.8% of all the sbhc
sbhc_data %>%
group_by(sbhc_sponsor) %>%
summarize(count=n(), enrollment=sum(total_enrolled)) %>%
arrange(desc(count)) %>%
mutate(percent=round((count/sum(count))*100,0), percent=paste0(percent,"%")) %>%
kbl(align="lrr", booktabs = TRUE, col.names = c("Sponsor", "# SBHC", "Percent")) %>%
kable_material(c("striped", "hover")) %>%
mutate(percent=round((count/sum(count))*100,0), percent=paste0(percent,"%"), enrollment=scales::comma(enrollment)) %>%
select(sbhc_sponsor, count, percent, enrollment) %>%
kable(align="lrrr", booktabs = TRUE, col.names = c("Sponsor", "# SBHC", "Percent", "Students Enrolled"), escape=FALSE) %>%
kable_material(c("striped", "hover")) %>%
kable_styling(full_width = FALSE) %>%
save_kable("../sbhc/visuals/melissa/sponsor_table.html")

# Read in
Expand Down
311 changes: 36 additions & 275 deletions visuals/melissa/sponsor_table.html

Large diffs are not rendered by default.

0 comments on commit a556244

Please sign in to comment.