@@ -16,7 +16,9 @@ library(purrr)
16
16
library(knitr)
17
17
library(DT)
18
18
library(ggrepel)
19
- acfrs_city_pop_added_char <- readRDS("acfrs_city_pop_added_char.RDS")
19
+ #acfrs_city_pop_added_char <- readRDS("acfrs_city_pop_added_char.RDS")
20
+ # probelem with integer64
21
+ acfrs_city_pop_added_char <- rio::import(here::here("acfrs_city_pop_added_char.csv"))
20
22
```
21
23
22
24
@@ -33,7 +35,9 @@ acfrs_city_pop_added_char <- readRDS("acfrs_city_pop_added_char.RDS")
33
35
mutate(
34
36
tot_liabilities_mil = round(total_liabilities/1000000),
35
37
tot_revenues_mil = round(revenues/1000000)) -> d1
36
-
38
+ ```
39
+
40
+ ``` {r}
37
41
d1 %>%
38
42
ggplot(aes(population, tot_liabilities_mil)) +
39
43
geom_point(color = "#8EA0CB", alpha = .5) +
@@ -184,8 +188,10 @@ top6_cities %>%
184
188
185
189
```
186
190
191
+
187
192
## Total revenues and Total Liabitity per person in 6 largest cities
188
- ``` {r, echo=FALSE, include=FALSE}
193
+
194
+ ``` {r, echo=FALSE}
189
195
dp %>%
190
196
ggplot(aes(name, Value, fill = type)) +
191
197
geom_bar(stat = "identity", position = "dodge") +
@@ -196,7 +202,7 @@ ggplot(aes(name, Value, fill = type)) +
196
202
197
203
labs(
198
204
x = "",
199
- y = "USD",
205
+ y = "USD (raw scale) ",
200
206
title = "Total revenues and Total Liabitity per person in 6 largest cities"
201
207
) +
202
208
@@ -205,7 +211,7 @@ ggplot(aes(name, Value, fill = type)) +
205
211
206
212
```
207
213
## Total revenues and Total Liabitity per person in 6 largest cities - Comparison
208
- ``` {r, results= 'asis', echo=FALSE, include=FALSE }
214
+ ``` {r, results= 'asis', echo=FALSE}
209
215
top6_cities %>%
210
216
pivot_longer(cols = 6:7,
211
217
names_to = "type",
@@ -220,7 +226,6 @@ ggplot(aes(name, Value, fill = type)) +
220
226
#average liabilities per person of all cities
221
227
geom_hline(yintercept = round(mean(acfrs_city_pop_added_char$total_liabilities/ acfrs_city_pop_added_char$population)),
222
228
linetype = "dashed", color = "#8EA0CB", size = 1) +
223
-
224
229
225
230
#average revenues per person of all cities
226
231
geom_hline(yintercept = round(mean(acfrs_city_pop_added_char$revenues/ acfrs_city_pop_added_char$population)),
@@ -230,8 +235,8 @@ geom_hline(yintercept = round(mean(acfrs_city_pop_added_char$revenues/ acfrs_cit
230
235
231
236
labs(
232
237
x = "",
233
- y = "USD",
234
- title = "Total revenues and Total Liabitity per person in 6 largest cities\nComparison with average values of all cities",
238
+ y = "USD (raw scale) ",
239
+ title = "Total revenues and Total Liabitity per person in 6 largest cities\nComparison with average values per person of all cities",
235
240
236
241
) +
237
242
0 commit comments