Skip to content
Newer
Older
100644 25 lines (22 sloc) 958 Bytes
45e3cb7 @sckott still adding documentation
sckott authored
1 #' Get PubMed Central article ID by inputting the doi for the article.
4cfc1cf @sckott Adding roxygen documentation
sckott authored
2 #' @param doi digital object identifier for an article in PLoS Journals
3 #' @param key your PLoS API key, either enter, or loads from .Rprofile
4 #' @param url the PLoS API url for the function (should be left to default)
5 #' @param ... optional additional curl options (debugging tools mostly)
6 #' @param curl If using in a loop, call getCurlHandle() first and pass
7 #' the returned value in here (avoids unnecessary footprint)
45e3cb7 @sckott still adding documentation
sckott authored
8 #' @return The PubMed Central article ID.
4cfc1cf @sckott Adding roxygen documentation
sckott authored
9 #' @examples \dontrun{
10 #' almpubmedcentid('10.1371/journal.pbio.0000012')
11 #' }
12 #' @export
59d32f9 @sckott added six new functions for Article Level Metrics API
sckott authored
13
14 almpubmedcentid <-
15
16 function(doi,
17 url = 'http://alm.plos.org/articles',
18 key = getOption("PlosApiKey", stop("need an API key for PLoS Journals")),
19 ...,
20 curl = getCurlHandle() ) {
21
22 url2 <- paste(url, "/", doi, '.json?api_key=', key, sep='')
23 tt <- getURLContent(url2)
4cfc1cf @sckott Adding roxygen documentation
sckott authored
24 fromJSON(I(tt))$article$pub_med_central
59d32f9 @sckott added six new functions for Article Level Metrics API
sckott authored
25 }
Something went wrong with that request. Please try again.