Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit86ccdfc

Browse files
authored
Merge pull request#55 from allenbaron/fix_ftxt
Update empc_ftxt() to indicate 1 input limit
2 parentsb3d4794 +99fb4ba commit86ccdfc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

‎R/epmc_ftxt.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#' Fetch Europe PMC fulltexts
1+
#' Fetch Europe PMC fulltext
22
#'
3-
#' This function loads fulltexts into R. Fulltexts are in XML format andare
3+
#' This function loadsonefulltext into R. Fulltext is in XML format andis
44
#' only provided for the Open Access subset of Europe PMC.
55
#'
66
#' @param ext_id character, PMCID.
@@ -15,8 +15,8 @@
1515
#' epmc_ftxt("PMC3639880")
1616
#' }
1717
epmc_ftxt<-function(ext_id=NULL) {
18-
if (!grepl("^PMC",ext_id))
19-
stop("Please providea PMCID, i.e.ids starting with 'PMC'")
18+
if (!grepl("^PMC",ext_id)|| length(ext_id)!=1)
19+
stop("Please provideone PMCID, i.e.id starting with 'PMC'")
2020
# call api
2121
req<-
2222
httr::RETRY("GET",

‎tests/testthat/test_epmc_ftxt.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ test_that("epmc_ftxt returns", {
55
a<- epmc_ftxt("PMC3257301")
66
b<- epmc_ftxt("PMC3639880")
77

8-
#correct class metadata
8+
#correct class metadata
99
expect_is(a,"xml_document")
1010
expect_is(b,"xml_document")
1111

1212
# fails correctly
1313
expect_error(epmc_ftxt("2PMC3448176"))
1414
expect_error(epmc_ftxt("PMC3476"))
1515
expect_error(epmc_ftxt("3476"),
16-
"Please providea PMCID, i.e.ids starting with 'PMC'"
17-
)
16+
"Please provideone PMCID, i.e.id starting with 'PMC'"
17+
)
1818
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp