| read_biblio | R Documentation |
Universal reader that handles files, folders, format detection, and generic CSV input. Accepts a single file, multiple files, or a directory.
read_biblio(
path,
format = "auto",
id = NULL,
authors = NULL,
keywords = NULL,
references = NULL,
countries = NULL,
affiliations = NULL,
journal = NULL,
sep = ";",
list_cols = NULL,
...,
actors = NULL
)
path |
Character. Path to a file, a vector of file paths, or a directory containing export files. |
format |
Character. File format:
|
id |
Character. Column name for document identifier. Only used
when |
authors, keywords, references, countries, affiliations |
Character. For
|
journal |
Character. For |
sep |
Character. Delimiter for splitting the mapped multi-valued
columns. Default |
list_cols |
Character vector. For |
... |
Additional arguments passed to the format-specific reader. |
actors |
Deprecated. Use the entity arguments ( |
A data frame.
# Auto-detect format from file content (here: a bundled OpenAlex CSV)
f <- system.file("extdata", "openalex_works.csv", package = "bibnets")
data <- read_biblio(f)
head(data[, c("id", "title", "year", "journal")])
# Read multiple files at once; auto-detects each format
f_scopus <- system.file("extdata", "scopus_sample.csv", package = "bibnets")
f_wos <- system.file("extdata", "wos_sample.txt", package = "bibnets")
combined <- read_biblio(c(f_scopus, f_wos))
head(combined[, c("id", "title", "year", "journal")])
# Read every supported export in a directory (here: the bundled extdata)
folder <- system.file("extdata", package = "bibnets")
all_data <- read_biblio(folder)
nrow(all_data)
# Custom CSV: map each source column onto a standard field by name.
# Naming columns implies format = "generic" (no need to pass it).
tmp <- tempfile(fileext = ".csv")
write.csv(data.frame(
doc_id = c("a", "b"),
Authors = c("Smith J; Jones A", "Davis M"),
Keywords = c("networks; bibliometrics", "analytics")
), tmp, row.names = FALSE)
generic <- read_biblio(tmp,
id = "doc_id",
authors = "Authors",
keywords = "Keywords",
sep = ";")
head(generic)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.