Skip to contents

Get a PMID from a DOI, and vice versa.

Usage

id_converter(x, type = NULL, ...)

Arguments

x

(character) One or more of: doi, pmid, pmcid, or manuscript id, see examples. required.

type

(character) one of doi, pmid, pmcid, or manuscript id

...

Curl args passed on to crul::verb-GET

References

https://www.ncbi.nlm.nih.gov/pmc/tools/id-converter-api/

Examples

if (FALSE) { # \dontrun{
# get a pmid/pmcid from a doi
id_converter("10.1038/ng.590")

# pmid to doi/pmcid
id_converter("20495566", "pmid")
id_converter("20495566")
# id_converter("20495566", "doi") #error

# pmcid to doi/pmid
id_converter("PMC2883744", "pmcid")
id_converter("PMC2883744")

# manuscript id
id_converter("NIHMS311352")

# more than 1 ID
id_converter(c("PMC3531190","PMC3245039"))

# error, wrong type passed for id given
# id_converter("PMC2883744", "doi")
# error, 200 ids or less
# ids <- cr_r(100)
# id_converter(c(ids, ids, ids))
} # }