-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquezon_city.R
More file actions
31 lines (23 loc) · 897 Bytes
/
quezon_city.R
File metadata and controls
31 lines (23 loc) · 897 Bytes
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
## Exercise: Get Quezon City specific data on cases from Data Drop #############
## Load libraries
remotes::install_github("como-ph/comoparams")
library(comoparams)
library(dplyr)
library(magrittr)
library(ggplot2)
library(openxlsx)
## Get daily cases, deaths and recovered for Quezon City
cases <- ph_get_cases() %>%
filter(CityMunRes == "QUEZON CITY") %>%
ph_calculate_cases()
## Get rates for Quezon City
rates <- ph_get_cases() %>%
filter(CityMunRes == "QUEZON CITY") %>%
ph_calculate_rates()
## Save results as XLSX file
params <- openxlsx::createWorkbook()
openxlsx::addWorksheet(wb = params, sheetName = "cases")
openxlsx::writeData(wb = params, x = cases, sheet = "cases")
openxlsx::addWorksheet(wb = params, sheetName = "rates")
openxlsx::writeData(wb = params, x = rates, sheet = "rates")
openxlsx::saveWorkbook(wb = params, file = "parameters.xlsx", overwrite = TRUE)