-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05-HIC_PIT_Trend_Table.Rmd
111 lines (97 loc) · 7.18 KB
/
05-HIC_PIT_Trend_Table.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 2nd Project: HIC/PIT Trend Table {-}
```{r echo=FALSE, warning=FALSE, message=FALSE, results='asis'}
HIC_PIT_project <- read_excel("Data/2nd_project/HIC_PIT_project.xlsx")
HIC_PIT_project <- HIC_PIT_project %>%
mutate(Award_Pct_Change = as.numeric(Award_Pct_Change),
PIT_Pct_Change = as.numeric(PIT_Pct_Change),
PerCap_Pct_Change = as.numeric(PerCap_Pct_Change),
Chronic_Pct_Change = as.numeric(Chronic_Pct_Change),
MI_Pct_Change = as.numeric(MI_Pct_Change),
SUD_Pct_Change = as.numeric(SUD_Pct_Change),
Total_bed_Pct_Change = as.numeric(Total_bed_Pct_Change),
ES_bed_Pct_Change = as.numeric(ES_bed_Pct_Change),
TH_bed_Pct_Change = as.numeric(TH_bed_Pct_Change),
RRH_bed_Pct_Change = as.numeric(RRH_bed_Pct_Change),
PSH_bed_Pct_Change = as.numeric(PSH_bed_Pct_Change),
OPH_bed_Pct_Change = as.numeric(OPH_bed_Pct_Change)
)
data4 <- SharedData$new(HIC_PIT_project)
bscols(
widths = c(3, NA),
list(
filter_select("CoC Name", "CoC Name", data4, ~`CoC Name`),
filter_checkbox("CoC Category", "CoC Category", data4, ~`CoC Category`),
filter_slider("Year", "Year", data4, ~Year, ticks = FALSE, sep = FALSE)
),
reactable(data4, searchable = TRUE, showPageSizeOptions = TRUE, defaultPageSize = 10, highlight = TRUE, bordered = TRUE, height = 1000,
columns = list(
`Award Amount` = colDef(format = colFormat(prefix = "$", separators = TRUE)),
Per_Capita = colDef(name = "Per Capita", format = colFormat(prefix = "$", separators = TRUE, digits = 2)),
Award_Pct_Change = colDef(name = "Award %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PIT_Pct_Change = colDef(name = "PIT %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PerCap_Pct_Change = colDef(name = "Per Capita %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
Chronic_Pct_Change = colDef(name = "Chronic %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
MI_Pct_Change = colDef(name = "MI %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
SUD_Pct_Change = colDef(name = "SUD %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
Total_bed_Pct_Change = colDef(name = "Total Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
ES_bed_Pct_Change = colDef(name = "ES Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
TH_bed_Pct_Change = colDef(name = "TH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
RRH_bed_Pct_Change = colDef(name = "RRH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PSH_bed_Pct_Change = colDef(name = "PSH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
OPH_bed_Pct_Change = colDef(name = "OPH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
`Sheltered Homeless` = colDef(format = colFormat(separators = TRUE)),
`Unsheltered Homeless` = colDef(format = colFormat(separators = TRUE)),
`Overall Homeless` = colDef(format = colFormat(separators = TRUE)),
`Overall Chronically Homeless` = colDef(format = colFormat(separators = TRUE)),
`Severely Mentally Ill` = colDef(format = colFormat(separators = TRUE)),
`Chronic Substance Abuse` = colDef(format = colFormat(separators = TRUE)),
`Total Year-Round Beds (ES, TH, RRH, PSH, OPH)` = colDef(name = "Total Beds", format = colFormat(separators = TRUE)),
`Total Year-Round Beds (ES)` = colDef(name = "ES Beds", format = colFormat(separators = TRUE)),
`Total Year-Round Beds (TH)` = colDef(name = "TH Beds", format = colFormat(separators = TRUE)),
`Total Year-Round Beds (RRH)` = colDef(name = "RRH Beds", format = colFormat(separators = TRUE)),
`Total Year-Round Beds (PSH)` = colDef(name = "PSH Beds", format = colFormat(separators = TRUE)),
`Total Year-Round Beds (OPH)` = colDef(name = "OPH Beds", format = colFormat(separators = TRUE))
)))
```
## CoC Average {-}
```{r echo=FALSE, warning=FALSE, message=FALSE, results='asis'}
#kable(HIC_PIT_project_by_CoC[1:381,])
HIC_PIT_project_by_CoC <- read_excel("Data/2nd_project/HIC_PIT_project_by_CoC.xlsx")
HIC_PIT_project_by_CoC <- HIC_PIT_project_by_CoC %>%
mutate(Award_Pct_Change = as.numeric(Award_Pct_Change),
PIT_Pct_Change = as.numeric(PIT_Pct_Change),
PerCap_Pct_Change = as.numeric(PerCap_Pct_Change),
Chronic_Pct_Change = as.numeric(Chronic_Pct_Change),
MI_Pct_Change = as.numeric(MI_Pct_Change),
SUD_Pct_Change = as.numeric(SUD_Pct_Change),
Total_bed_Pct_Change = as.numeric(Total_bed_Pct_Change),
ES_bed_Pct_Change = as.numeric(ES_bed_Pct_Change),
TH_bed_Pct_Change = as.numeric(TH_bed_Pct_Change),
RRH_bed_Pct_Change = as.numeric(RRH_bed_Pct_Change),
PSH_bed_Pct_Change = as.numeric(PSH_bed_Pct_Change),
OPH_bed_Pct_Change = as.numeric(OPH_bed_Pct_Change)
)
data5 <- SharedData$new(HIC_PIT_project_by_CoC)
bscols(
widths = c(3, NA),
list(
filter_select("CoC Name", "CoC Name", data5, ~`CoC Name`),
filter_checkbox("CoC Category", "CoC Category", data5, ~`CoC Category`)
),
reactable(data5, searchable = TRUE, showPageSizeOptions = TRUE, defaultPageSize = 10, highlight = TRUE, bordered = TRUE, height = 1000,
columns = list(
`Award Amount` = colDef(format = colFormat(prefix = "$", separators = TRUE)),
Award_Pct_Change = colDef(name = "Award %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PIT_Pct_Change = colDef(name = "PIT %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PerCap_Pct_Change = colDef(name = "Per Capita %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
Chronic_Pct_Change = colDef(name = "Chronic %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
MI_Pct_Change = colDef(name = "MI %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
SUD_Pct_Change = colDef(name = "SUD %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
Total_bed_Pct_Change = colDef(name = "Total Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
ES_bed_Pct_Change = colDef(name = "ES Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
TH_bed_Pct_Change = colDef(name = "TH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
RRH_bed_Pct_Change = colDef(name = "RRH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
PSH_bed_Pct_Change = colDef(name = "PSH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2)),
OPH_bed_Pct_Change = colDef(name = "OPH Beds %Change", format = colFormat(suffix = "%", separators = TRUE, digits = 2))
)))
```