rKolada is an R package for downloading, inspecting and processing data from Kolada, an open database containing over 4,000 Key Performance Indicators for Swedish municipalities and regions.
To learn more about using rKolada, it is recommended you use the following resources in order:
Getting started with rKolada
- To get up and running quickly with rKolada, please see the vignette A quick start guide to rKolada.
- For an introduction to rKolada and the design principles of functions included, please see Introduction to rKolada.
- See the Reference section of the package homepage to learn about the full set of functionality included with the package.
rKolada is open source licensed under the Affero Gnu Public License version 3. This means you are free to download the source, modify and redistribute it as you please, but any copies or modifications must retain the original license. Please see the file LICENSE.md for further information.
Installation
rKolada is on CRAN. To install it, run the following code in R:
install.packages("rKolada")To install the latest development version from GitHub, use the remotes package:
Enhanced caching with nordstatExtras
For multi-user web applications or workflows that benefit from a shared, persistent cache, rKolada integrates with the nordstatExtras package. When installed, get_values(), get_kpi(), and other functions can write to a shared SQLite file instead of per-session .rds files:
# install.packages("devtools")
devtools::install_github("LCHansson/nordstatExtras")
library(nordstatExtras)
handle <- nxt_open("cache.sqlite")
# Data and metadata are cached in the same SQLite file
kpis <- get_kpi(cache = TRUE, cache_location = handle)
vals <- get_values(
kpi = "N03700", municipality = c("0180", "1480"),
cache = TRUE, cache_location = handle
)
nxt_close(handle)Features include cell-level deduplication across overlapping queries, cross-query freshness propagation, and FTS5-powered typeahead search via nxt_search(). See the nordstatExtras README for details.
Contributing
You are welcome to contribute to the further development of the rKolada package in any of the following ways:
- Open an issue
- Clone this repo, make modifications and create a pull request
- Spread the word!
Related packages
rKolada is part of a family of R packages for Swedish and Nordic open statistics that share the same design philosophy — tibble-based, pipe-friendly, and offline-safe:
- pixieweb — R client for PX-Web APIs (Statistics Sweden, Statistics Norway, Statistics Finland, and more)
- rTrafa — R client for the Trafa API of Swedish transport statistics
Code of Conduct
Please note that the rKolada project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.