Nothing
#' Extract article metadata from a PMC XML file.
#'
#' Reads a PMC XML file and returns its metadata as a one-row data frame:
#' journal, publisher, article title, authors and affiliations, identifiers
#' (PMID, PMCID, DOI), publication dates, and figure / table / reference
#' counts.
#'
#' @param filename The path to the PMC XML file as a string.
#' @param remove_ns TRUE if an XML namespace should be removed, else FALSE
#' (default).
#' @return A one-row tibble of metadata. The column `is_success` indicates
#' whether the file was parsed successfully.
#' @examples
#' \donttest{
#' filepath <- system.file(
#' "extdata", "PMID32171256-PMC7071725.xml", package = "rtransparency"
#' )
#' rt_meta_pmc(filepath, remove_ns = TRUE)
#' }
#' @export
rt_meta_pmc <- function(filename, remove_ns = FALSE) {
# A lot of the PMC XML files are malformed
article_xml <- tryCatch(.get_xml(filename, remove_ns), error = function(e) e)
if (inherits(article_xml, "error")) {
return(tibble::tibble(filename = filename, is_success = FALSE))
}
id_ls <- list(filename = filename)
meta_ls <- .xml_metadata_c(article_xml, as_list = TRUE)
status_ls <- list(is_success = TRUE)
tibble::as_tibble(c(id_ls, meta_ls, status_ls))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.