Skip to content

Commit

Permalink
Update empc_ftxt() to indicate 1 input limit
Browse files Browse the repository at this point in the history
  • Loading branch information
allenbaron committed Nov 17, 2023
1 parent eaba207 commit 2652c6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/epmc_ftxt.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Fetch Europe PMC full texts
#' Fetch Europe PMC full text
#'
#' This function loads full texts into R. Full texts are in XML format and are
#' This function loads one full text into R. Full text is in XML format and is
#' only provided for the Open Access subset of Europe PMC.
#'
#' @param ext_id character, PMCID.
Expand All @@ -15,8 +15,8 @@
#' epmc_ftxt("PMC3639880")
#' }
epmc_ftxt <- function(ext_id = NULL) {
if (!grepl("^PMC", ext_id))
stop("Please provide a PMCID, i.e. ids starting with 'PMC'")
if (!grepl("^PMC", ext_id) || length(ext_id) != 1)
stop("Please provide one PMCID, i.e. id starting with 'PMC'")
# call api
req <-
httr::RETRY("GET",
Expand Down

0 comments on commit 2652c6d

Please sign in to comment.