Download the latest and archived datasets from the Quality of Government Institute using the function read_qog()
. See ?read_qog
for help, package vignette for more examples and data.markuskainu.fi/qog/ for interactive metadata.
Installation
remotes::install_github("ropengov/rqog")
Alternatively, you can use the r-universe:
# Enable this universe
options(repos = c(
ropengov = "https://ropengov.r-universe.dev",
CRAN = "https://cloud.r-project.org"
))
install.packages("rqog")
Use
Download data
Browse metadata
library(rqog)
meta_std_ts_2022[grepl("human development", meta_std_ts_2022$name, ignore.case = TRUE),]
#> # A tibble: 2 × 5
#> code name value label class
#> <chr> <chr> <dbl> <chr> <chr>
#> 1 iiag_hd Human Development NA <NA> numeric
#> 2 undp_hdi Human Development Index NA <NA> numeric
Plot an indicator
library(ggplot2)
ggplot(dat[!is.na(dat$undp_hdi),],
aes(x = year, y = undp_hdi, color = cname)) +
geom_line() +
theme(legend.position = "none")
Copyright (C) 2012-2022 Markus Kainu markuskainu@gmail.com. MIT-licence.