knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Database content

The tables in the database have the following table names, column names and row and column counts:

library(institutions)
library(dplyr, warn.conflicts = FALSE)
library(purrr)
library(knitr)

institutions_download()

# fcn to describe a table

desc_table <- function(x)
  tibble(
    tablename = x,
    rowcount = institutions_table(x) %>% nrow(),
    colcount = institutions_table(x) %>% ncol(),
    colnames = institutions_table(x) %>% names() %>% paste0(collapse = ", ")
  )

# iterate over existing tables and display results

tables <- institutions_tables()

desc <-
 tables %>% map_df(desc_table) %>%
 arrange(desc(rowcount))

knitr::kable(desc)

The tables in the database are based on the CSV format. This format is described in more detail here: https://grid.ac/format.

Size on disk

The size on disk for some of the generated files (the SQLite db is larger than the zipped CSVs downloaded due to the Full Text Search tables that are generated and added to the database):

cfg <- institutions_cfg()

print_fs <- function(x) 
  sprintf("File %s has size %s", basename(x), 
          utils:::format.object_size(file.info(x)$size, "auto"))

files <- c(cfg$zip, cfg$db)

sizes <- map_chr(files, print_fs)

r sizes[1]

r sizes[2]



KTH-Library/institutions documentation built on June 10, 2025, 10:04 a.m.