knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) options(width = "100") require(magrittr) require(viafr)
This R package uses the VIAF (Virtual International Authority File) API. VIAF is an OCLC service that combines multiple LAM (Library, Archive, and Museum) name authority files into a single name authority service. It thus provides direct access to linked names for the same entity across the world's major name authority files, including national and regional variations in language, character set, and spelling. For more information go to https://viaf.org/.
You can install the released version of viafr from CRAN with:
install.packages("viafr")
To install the development version from GitHub use:
# install.packages("devtools") devtools::install_github("stefanieschneider/viafr")
The viafr package functions use the VIAF (Virtual International Authority File) API. Optional VIAF API query parameters can be passed into each function. For information on supported query parameters, please see https://www.oclc.org/developer/api/oclc-apis/viaf.en.html.
viaf_get()
returns a tibble, where each row contains information about the respective VIAF identifier, whereas viaf_search()
and viaf_suggest()
each produce a named list of tibbles, with each tibble containing information about the respective search query. The MARC 21 field definitions are used, see, e.g., https://www.loc.gov/marc/bibliographic/.
(result_search <- viaf_search("Menzel", maximumRecords = 5)) # Retrieve a tibble of all source identifiers (source_ids <- dplyr::pull(result_search$`Menzel`, source_ids)) # Retrieve a tibble of data for the second search result (text <- dplyr::pull(result_search$`Menzel`, text) %>% purrr::pluck(2))
(result_suggest <- viaf_suggest("austen")) # Retrieve source identifiers for the most relevant search result dplyr::filter(result_suggest$`austen`, score > 10000) %>% dplyr::pull(source_ids) %>% purrr::pluck(1)
Please report issues, feature requests, and questions to the GitHub issue tracker. We have a Contributor Code of Conduct. By participating in viafr you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.