knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

XsearchLIBRIS

Lifecycle: experimental R-CMD-check

The goal of XsearchLIBRIS is to provide access to search results from LIBRIS Xsearch API directly in R.

LIBRIS is an online search service of the National Library of Sweden. Search national, academic, and several public libraries of Sweden for books, periodicals, articles, maps, posters, printed music, electronic resources, and more.

Installation

You can install the latest version of XsearchLIBRIS from GitHub with:

#install.packages("devtools")
install_github("KTH-Library/XsearchLIBRIS", dependencies = TRUE)

Example

The database used can be specified - the default is to use LIBRIS but "swepub" is also available.

This is a basic example which shows you how make a search:

library(XsearchLIBRIS)
suppressPackageStartupMessages(library(dplyr))
library(knitr)

# search and display first two hits for "film noir"
kable(xsearch(query = "WAMK:\"film noir\"")$content %>% slice(1:2))

# search for publications by Vitruvius in Swedish
"PERS:(vitruvius) SPR:swe" %>% 
  xsearch() %>% 
  .$content %>%
  kable()

# search SwePub for publications about timber framing in Swedish
xsearch(query = "stolpverk SPR:swe", database = "swepub") %>%
  .$content %>% 
  mutate(summary = paste(
    # generate summary snippet in markdown format
    sprintf("[%s](%s)", identifier, sprintf("%s (%s:%s)", title, type, relation)),
    sprintf("\n%s...", substr(description, 1, 250)))
  ) %>%
  select(`Search hit summaries` = summary) %>%
  kable()


KTH-Library/XsearchLIBRIS documentation built on Jan. 29, 2025, 5:14 p.m.