Skip to contents

The main parts of the bibliomatrix package are:

  • A public dataset for the KTH Annual Bibliometric Monitoring (ABM)
  • A Shiny app and a flexdashboard layout for presenting the ABM
  • Functions related to filling the ABM presentation with results

Getting started

First load some useful packages, including bibliomatrix:

Data for Annual Bibliometric Monitoring (ABM)

In order to get data from the Microsoft SQL Server database, an .Renviron file is currently required with values being provided for the following envvars: DBUSER (the MSSQL Server service account name for the BIBMON db), DBPASS, DBHOST (the hostname for the MSSQL server) and DBNAME (use “BIBMON”).

Once this has been provided in the .Renviron file, data for the ABM tables can be retrieved.

NOTE: For the public part of ABM, no database connection is needed, see Using bundled data in bibliomatrix.

# Open a connection to Microsoft SQL Server BIBMON database
bibmon <- con_bib("mssql")

# get data for ABM table 1
kth_data <- abm_data(bibmon, unit_code = "KTH", analysisId = abm_config()$analysis_id)
t1 <- abm_table1(kth_data)

# display first few results
t1 %>% 
  slice(1:5) %>% 
  select(1:2) %>% 
  kable()
Publication_Type_DiVA 2015
Article, peer review 1514.91639
Article, other 97.35675
Conference paper, peer review 873.15176
Conference paper, other 233.38373
Book 19.50000

# You can build a sqlite3 databsae for local use (this will take a while the first time)
db_sync()
localdb <- con_bib("sqlite")
kth_data_local <- abm_data(localdb, unit_code = "KTH", analysisId = abm_config()$analysis_id)
t2 <- abm_table1(kth_data_local)

# are the results the same?
identical(t1, t2)
#> [1] TRUE

# what about performance?
bench_time(abm_table1(abm_data(con = bibmon, unit_code = "KTH", analysisId = abm_config()$analysis_id)))
#> process    real 
#>   2.88s  21.27s
bench_time(abm_table1(abm_data(con = localdb, unit_code = "KTH", analysisId = abm_config()$analysis_id)))
#> process    real 
#>   6.33s   6.66s

dbDisconnect(bibmon)
dbDisconnect(localdb)