-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadlib_graphs.Rmd
More file actions
138 lines (102 loc) · 3.4 KB
/
adlib_graphs.Rmd
File metadata and controls
138 lines (102 loc) · 3.4 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
title: "adlib_graphs"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
#counties within state by provider densities (top five)
#counties within state by provider densities (bottom five)
#counties within a state by provider number (top five)
#counties within a state by provider number (bottom five)
#counties within state by provider densities by taxonomy (top five)
#counties within state by provider densities by taxonomy (bottom five)
#counties within a state by provider number by taxonomy (top five)
#counties within a state by provider number by taxonomy (bottom five)
#counties within state by provider densities (top five)
```{r}
#these will need to be filled in once we have the actual functions done
countyproviderdensityhigh <- function(state) {
providersbycountydens <- listofproviderdensities %>%
filter(STATE = state) %>%
group_by(CTY) %>%
count() %>%
arrange(n)
providersbycounty.high <- head(providersbycounty, 5)
plot<-ggplot(providersbycounty.high, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Provider density")
plot
}
```
#counties within state by provider density (bottom five)
```{r}
countyproviderdensityhigh <- function(state) {
providersbycountylow <- listofproviderdensities %>%
filter(STATE = state) %>%
group_by(CTY) %>%
count() %>%
arrange(desc = TRUE)
providersbycounty.low <- head(providersbycountylow, 5)
plot<-ggplot(providersbycounty.low, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Provider density")
plot
}
```
#counties within a state by provider number (top five)
```{r}
countyprovidernumberhigh <- function(state) {
providersbycountynumhigh <- listofprovidernumbers %>%
filter(STATE = state) %>%
group_by(CTY) %>%
count() %>%
arrange(desc = TRUE)
providersbycountynum.high <- head(providersbycountynumhigh, 5)
plot<-ggplot(providersbycountynum.high, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Number of providers")
plot
}
```
#counties within a state by provider number (bottom five)
```{r}
countyprovidernumberlow <- function(state) {
providersbycountynumlow <- listofprovidernumbers %>%
filter(STATE = state) %>%
group_by(CTY) %>%
count() %>%
arrange()
providersbycountynum.low <- head(providersbycountynumlow, 5)
plot<-ggplot(providersbycountynum.low, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Number of providers")
plot
}
```
#counties within state by provider densities by taxonomy (top five)
```{r}
countyproviderdensityhigh <- function(state, taxonomy) {
providersbycountydens <- listofproviderdensities %>%
filter(STATE = state) %>%
filter(taxonomy = "taxonomy")
group_by(CTY) %>%
count() %>%
arrange(n)
providersbycounty.high <- head(providersbycounty, 5)
plot<-ggplot(providersbycounty.high, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Provider density")
plot
}
```
#counties within state by provider densities by taxonomy (bottom five)
```{r}
countyproviderdensityhigh <- function(state, taxonomy) {
providersbycountylow <- listofproviderdensities %>%
filter(STATE = state) %>%
filter(taxonomy = taxonomy)
group_by(CTY) %>%
count() %>%
arrange(desc = TRUE)
providersbycounty.low <- head(providersbycountylow, 5)
plot<-ggplot(providersbycounty.low, aes(x=factor(n), y=nn))+
geom_bar(stat="identity") + labs(x = "County", y = "Provider density")
plot
}
```