get_interventions_data.Rd
Data available here: https://data.humdata.org/dataset/acaps-covid19-government-measures-dataset#
get_interventions_data()
a dataframe of government interventions compiled by ACAPS
Paul Campbell @paulcampbell91
## Code get_interventions_data#> function () #> { #> ch <- memoise::cache_filesystem(".cache") #> mem_download <- memoise::memoise(download.file, cache = ch) #> base_url <- "https://data.humdata.org" #> dl_url <- xml2::read_html(paste0(base_url, "/dataset/acaps-covid19-government-measures-dataset#")) %>% #> rvest::html_node(css = ".resource-item+ .resource-item .ga-download") %>% #> rvest::html_attr("href") %>% xml2::url_absolute(base_url) #> temp <- tempdir() #> filename <- "interventions.xlsx" #> mem_download(dl_url, destfile = file.path(temp, filename), #> mode = "wb", quiet = TRUE) #> data <- readxl::read_excel(file.path(temp, filename), sheet = "Database") %>% #> dplyr::mutate_if(lubridate::is.POSIXct, lubridate::as_date) #> names(data) <- tolower(names(data)) #> return(data) #> } #> <bytecode: 0x7ff9018b3010> #> <environment: namespace:NCoVUtils>