rOG-badge R-CMD-check CRAN_Status_Badge r-universe experimental

Watch on GitHub Star on GitHub Follow on Twitter

sorvi

sorvi package was originally intended for hosting various algorithms for Finnish open goverment data in R. After being superseded by later rOpenGov packages that are more specialized in scope (such as geofi, hetu and pxweb), sorvi has now found a new life in hosting various functions that are helpful in rOpenGov package maintenance, authoring and preparing presentations.

Originally rOpenGov/sorvi was a fork of juusohaapanen/soRvi-dev but rOpenGov’s sorvi branch has since taken a life of its own. The fork was detached fron juusohaapanen’s branch in November 2021.

Installation

You can install the development version of sorvi from GitHub with:

# install.packages("devtools")
devtools::install_github("rOpenGov/sorvi")

Development version can be also installed using the r-universe:

# Enable this universe
options(repos = c(
  ropengov = "https://ropengov.r-universe.dev",
  CRAN = "https://cloud.r-project.org"
))
install.packages("sorvi")

There is still a CRAN release version of sorvi and while it passes CRAN checks without problems it contains mostly outdated functions. It is therefore highly recommended to use development version of the package.

Using the package

Loading the package in R:

library(sorvi)

Get download statistics of eurostat-package, by year:

df <- cran_downloads(pkgs = "eurostat", sum = "by_year", use.cache = FALSE)
df
#> # A tibble: 5 × 3
#> # Groups:   year [5]
#>    year package      n
#>   <dbl> <fct>    <int>
#> 1  2017 eurostat 12482
#> 2  2018 eurostat 18932
#> 3  2019 eurostat 28454
#> 4  2020 eurostat 31298
#> 5  2021 eurostat 30307

Get download statistics of various rOpenGov packages over time and draw a chart:

packages <- c("eurostat", "giscoR", "sotkanet", "geofi", "sweidnumbr")
plot <- cran_downloads(pkgs = packages, sum = "total", output = "plot", use.cache = FALSE)
plot

For more (partly outdated) examples, check the tutorial page.

Contributing

Acknowledgements

Kindly cite this work as follows: Leo Lahti, Juuso Parkkinen, Joona Lehtomäki, Jussi Paananen, Einari Happonen, Juuso Haapanen, Pyry Kantanen. sorvi - Finnish Open Government Data Toolkit. URL: http://ropengov.github.io/sorvi/

We are grateful to all contributors! This project is part of rOpenGov.