From 54d7f99a9aacf1646541fa402245534935993e61 Mon Sep 17 00:00:00 2001 From: labouz Date: Fri, 17 Dec 2021 14:46:29 -0500 Subject: [PATCH] update version --- DESCRIPTION | 5 +++-- NAMESPACE | 2 ++ R/fetch_fulltext.R | 4 ++-- man/fetch_fulltext.Rd | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2a22170..0b532b9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: PMCfetchR Title: Extract Full-Text Articles from NIH NCBI's PMC Articles Dataset in AWS Cloud -Version: 0.0.0.9000 +Version: 1.0.0 Authors@R: person("Layla", "Bouzoubaa", , "lb3338@drexel.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6616-0950")) @@ -23,7 +23,8 @@ Imports: aws.s3, magrittr, rlang, - xml2 + xml2, + stringr Suggests: testthat (>= 3.0.0) Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index de2764c..645d61a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -9,6 +9,8 @@ importFrom(jsonlite,fromJSON) importFrom(magrittr,"%>%") importFrom(purrr,map_df) importFrom(rlang,arg_match) +importFrom(stringr,str_extract) +importFrom(stringr,str_remove) importFrom(tibble,tibble) importFrom(tidypmc,pmc_text) importFrom(utils,capture.output) diff --git a/R/fetch_fulltext.R b/R/fetch_fulltext.R index dc74277..02311c8 100644 --- a/R/fetch_fulltext.R +++ b/R/fetch_fulltext.R @@ -14,7 +14,7 @@ #' @importFrom magrittr %>% #' @importFrom rlang arg_match #' @importFrom xml2 read_xml -#' @importFrom stringr str_extract +#' @importFrom stringr str_extract str_remove #' @export #' #' @examples @@ -72,7 +72,7 @@ fetch_fulltext <- function(id, vars = c("all", "section", "paragraph", "sentence # FAILSAFE FUNCTION THAT GETS CALLED IF NOTHING IS RETURNED FROM AWS------------ fetch_paper_eutility <- function (pmcid) { # strip 'PMC' from PMCID - id <- str_remove(pmcid, "PMC") + id <- stringr::str_remove(pmcid, "PMC") api <- paste0("https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=",id) response <- xml2::read_xml(api) diff --git a/man/fetch_fulltext.Rd b/man/fetch_fulltext.Rd index 05d153c..fecff0a 100644 --- a/man/fetch_fulltext.Rd +++ b/man/fetch_fulltext.Rd @@ -19,6 +19,6 @@ a tidy \code{data.frame} containing each manuscript retrieved, tokenized by sent Get full-text articles from PMC Open Access Subset in an AWS S3 bucket } \examples{ -fetch_fulltext("PMC2480524") -fetch_fulltext("PMC2480524", vars = c("text")) +fetch_fulltext("PMC5465829") +fetch_fulltext("PMC5465829", vars = c("text")) }