get_urn_frequencies {dhlabR}R Documentation

Get word count frequencies for a list of URNs or dhlabids

Description

This function takes a list of National Library of Norway (NB) identifiers, either URNs or dhlabids, and returns the word count for each object. It queries the National Library's API to fetch the word count data.

Usage

get_urn_frequencies(urns = NULL, dhlabids = NULL)

Arguments

urns

A list or data frame of URNs from the National Library of Norway. If a data frame, it should have a column named 'urn'.

dhlabids

A list of 'dhlabid' ids from National Library DHLAB.

Value

A data frame with two columns: 'dhlabid' and 'frequencies'. Each row represents a library text resource with its corresponding word count.

Examples

# Example usage with a list of URNs
urn_list <- c("URN:NBN:no-nb_digibok_2008051404065", "URN:NBN:no-nb_digibok_2010092120011")
word_counts <- get_urn_frequencies(urn_list)
print(word_counts)

# Example usage with a data frame of URNs
urn_list <-  c("URN:NBN:no-nb_digibok_2008051404065", "URN:NBN:no-nb_digibok_2010092120011")
urn_dataframe <- data.frame(urn = urn_list)
word_counts <- get_urn_frequencies(urn_dataframe)


[Package dhlabR version 1.0.2 Index]