cit_oid: Get Citoid data

Description Usage Arguments Details Value References Examples

Description

Get Citoid data

Usage

1
2
3
cit_oid(id, format = "mediawiki", accept_language = NULL, ...)

cit_oid_(id, format = "mediawiki", accept_language = NULL, ...)

Arguments

id

(character) id of an article, DOI, ISBN, PMCID or PMID

format

(character) the format to use for the resulting citation data. one of mediawiki (default), zotero, mediawiki-basefields, bibtex

accept_language

(character) for some articles the result depends on the accept language value, so provide it if localized content is required

...

curl options passed on to crul::verb-GET

Details

cit_oid_() gets raw text (either bibtex or JSON), and cit_oid() parses the text as appropriate for the type

Value

list of lists or character, see http://opencitations.net/index/coci/api/v1 for explanation of the resulting columns

References

https://en.wikipedia.org/api/rest_v1/#!/Citation/getCitation, https://www.mediawiki.org/wiki/Citoid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
url<-"https://en.wikipedia.org/api/rest_v1/data/citation/mediawiki/30446726"
if (crul::ok(url)) {
  pmid1 <- 30446726
  cit_oid(pmid1)
}

## Not run: 
doi1 <- "10.1108/jd-12-2013-0166"
doi2 <- "10.1371/journal.pone.0058568"
pmid1 <- 30446726
pmcid1 <- "PMC4679344"
isbn1 <- 1439895619

# different formats
cit_oid(doi1)
cit_oid(pmid1, format = "mediawiki")
cit_oid(pmid1, format = "zotero")
cit_oid(pmid1, format = "mediawiki-basefields")
cat(cit_oid(pmid1, format = "bibtex")[[1]])

# PMID example
cit_oid(pmid1, verbose = TRUE)

# ISBN example
cit_oid(isbn1, verbose = TRUE)

# PMCID example
cit_oid(pmcid1)

# set the accept language
x <- cit_oid(pmid1, accept_language = "fr-FR", verbose = TRUE)
x <- cit_oid(doi2, accept_language = "de-DE", verbose = TRUE)

# just get raw text/json
cit_oid_(pmcid1)

# many ids at once
cit_oid(id = c(pmid1, pmcid1, isbn1))
cit_oid_(id = c(pmid1, pmcid1, isbn1))
cit_oid_(id = c(pmid1, pmcid1, isbn1), format = "bibtex")

## End(Not run)

rcitoid documentation built on May 2, 2019, 5:57 a.m.