Learn R Programming

webchem (version 0.4.0)

get_csid: Retrieve ChemSpider ID

Description

Return Chemspider ID (CSID) for a search query, see https://www.chemspider.com/.

Usage

get_csid(query, token = NULL, first = TRUE, verbose = TRUE, ...)

Arguments

query

charachter; search term.

token

character; your security token.

first

logical; If TRUE (default) return only first result.

verbose

logical; should a verbose output be printed on the console?

...

currently not used.

Value

if first = TRUE a character vector with ChemSpider IDs, otherwise a list.

See Also

cs_compinfo and cs_extcompinfo to retrieve compound details from csid.

Examples

Run this code
# NOT RUN {
# Fails because no TOKEN is included
token <- '<YOUR-SECURITY-TOKEN>'
get_csid("Triclosan", token = token)[[1]]
# [1] "5363"
get_csid(c("Triclosan", "50-00-0"), token = token)
# }

Run the code above in your browser using DataLab