View source: R/read-openalex.R
| read_openalex | R Documentation |
Takes the output of openalexR::oa_fetch() (a tibble/data frame of works)
and converts it to the standardized bibnets format with list-columns.
read_openalex(data)
data |
A data frame from |
A data frame in the standard bibnets format: id, title,
year, journal, doi, cited_by_count, abstract, type,
plus list-columns authors, references, and keywords.
# Construct a minimal data frame matching the structure returned by
# openalexR::oa_fetch(entity = "works", ...). In practice, pass the
# result of oa_fetch() directly.
raw <- data.frame(
id = c("W123", "W456"),
display_name = c("First paper", "Second paper"),
publication_year = c(2022L, 2021L),
so = c("Journal A", "Journal B"),
doi = c("https://doi.org/10.1/a", "https://doi.org/10.2/b"),
cited_by_count = c(5L, 12L),
stringsAsFactors = FALSE
)
raw$author <- list(
data.frame(au_display_name = c("Smith J", "Jones A"),
stringsAsFactors = FALSE),
data.frame(au_display_name = "Davis M", stringsAsFactors = FALSE)
)
raw$referenced_works <- list(c("W100", "W200"), "W123")
data <- read_openalex(raw)
head(data[, c("id", "title", "year", "journal", "doi")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.