rt_all_pmc: Identify and extract all transparency indicators from a PMC...

rt_all_pmcR Documentation

Identify and extract all transparency indicators from a PMC XML.

Description

Takes a PMC XML and returns relevant meta-data, as well as whether the article carries each of the eight transparency indicators: Conflicts of Interest (COI), Funding, Protocol Registration, Novelty, Replication, Data sharing, Code sharing and disclosure of generative-AI use. Where a statement is found, the relevant text is also extracted. This is the single-call entry point; it covers the same data and code detection as [rt_data_code_pmc()] and the same AI detection as [rt_ai_pmc()].

Usage

rt_all_pmc(filename, remove_ns = FALSE, all_meta = FALSE)

Arguments

filename

The name of the PMC XML as a string.

remove_ns

TRUE if an XML namespace exists, else FALSE (default).

all_meta

TRUE extracts all meta-data, FALSE extracts some (default).

Value

A dataframe of results. It returns the unique identifiers of the article, whether each indicator of transparency was identified ('is_coi_pred', 'is_fund_pred', 'is_register_pred', 'is_novelty_pred', 'is_replication_pred', 'is_open_data', 'is_open_code' and the year-gated 'is_ai_pred'), the relevant text identified, whether it was identified through a dedicated XML tag (such variables include "pmc" in their name, e.g. “fund_pmc_source”) and whether each labelling function identified relevant text or not. The labeling functions are returned to add flexibility in how this package is used; for example, future definitions of Registration may differ from the one we used. If a labelling function returns NA it means that it was not run. 'is_ai_pred' is 'NA' for articles published before 2023 (see [rt_ai_pmc()]).

Examples


# Path to a bundled example PMC XML file.
filepath <- system.file(
  "extdata", "PMID32171256-PMC7071725.xml", package = "rtransparency"
)

# Identify and extract meta-data and indicators of transparency.
results_table <- rt_all_pmc(filepath, remove_ns = TRUE, all_meta = TRUE)


rtransparency documentation built on July 1, 2026, 9:07 a.m.