sorvi Tutorial

rOpenGov core team

2022-05-28

Finnish open (government) data toolkit for R

Introduction

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.

Installation

Install the stable release version from CRAN in R:

install.packages("sorvi")

Alternatively, use remotes package to install the latest development version from GitHub:

library(remotes)
remotes::install_github("ropengov/sorvi")

Loading the package in R command line:

library(sorvi)

Using the package

The number of functions in this package has been reduced compared to older versions.

Get download statistics of eurostat-package, by year:

df <- cran_downloads(pkgs = "eurostat", sum = "by_year", use.cache = FALSE)
df

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

Further data sets

Possible new data sets to include are listed in the wiki.

Licensing and Citations

This work can be freely used, modified and distributed under the Two-clause BSD license.

citation("sorvi")
#> 
#> Kindly cite the sorvi R package as follows:
#> 
#>   Leo Lahti, Juuso Parkkinen, Joona Lehtomaki, Juuso Haapanen, Einari
#>   Happonen, Jussi Paananen and Pyry Kantanen (2022). sorvi: Finnish
#>   open data toolkit for R. R package version 0.8.20 URL:
#>   https://github.com/rOpenGov/sorvi
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Misc{,
#>     title = {sorvi: Finnish open government data toolkit for R},
#>     author = {Leo Lahti and Juuso Parkkinen and Joona Lehtomaki and Juuso Haapanen and Einari Happonen and Jussi Paananen and Pyry Kantanen},
#>     doi = {10.5281/zenodo.10280},
#>     url = {https://github.com/rOpenGov/sorvi},
#>     year = {2022},
#>     note = {R package version 0.8.20},
#>   }
#> 
#> Many thanks for all contributors!

Session info

This vignette was created with

sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 22.04 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/xxx/bin/R-4.2.0/lib/libRblas.so
#> LAPACK: /home/xxx/bin/R-4.2.0/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] sorvi_0.8.20
#> 
#> loaded via a namespace (and not attached):
#>  [1] bslib_0.3.1        compiler_4.2.0     pillar_1.7.0       RColorBrewer_1.1-3
#>  [5] jquerylib_0.1.4    tools_4.2.0        digest_0.6.29      lubridate_1.8.0   
#>  [9] jsonlite_1.8.0     evaluate_0.15      lifecycle_1.0.1    tibble_3.1.7      
#> [13] gtable_0.3.0       checkmate_2.1.0    pkgconfig_2.0.3    rlang_1.0.2       
#> [17] DBI_1.1.2          cli_3.3.0          yaml_2.3.5         xfun_0.30         
#> [21] fastmap_1.1.0      xml2_1.3.3         httr_1.4.3         dplyr_1.0.9       
#> [25] stringr_1.4.0      knitr_1.39         generics_0.1.2     sass_0.4.1        
#> [29] vctrs_0.4.1        dlstats_0.1.5      tidyselect_1.1.2   grid_4.2.0        
#> [33] glue_1.6.2         R6_2.5.1           gh_1.3.0           fansi_1.0.3       
#> [37] rmarkdown_2.14.1   tidyr_1.2.0        purrr_0.3.4        ggplot2_3.3.6     
#> [41] magrittr_2.0.3     backports_1.4.1    scales_1.2.0       htmltools_0.5.2   
#> [45] ellipsis_0.3.2     rvest_1.0.2        assertthat_0.2.1   colorspace_2.0-3  
#> [49] utf8_1.2.2         stringi_1.7.6      munsell_0.5.0      crayon_1.5.1

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher