get_csid: Retrieve ChemSpider ID

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/chemspider.R

Description

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

Usage

1
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.

Note

A security token is neeeded. Please register at RSC. https://www.rsc.org/rsc-id/register for a security token. Please respect the Terms & conditions https://www.rsc.org/help-legal/legal/terms-conditions/.

Author(s)

Eduard Szoecs, [email protected]

See Also

cs_compinfo and cs_extcompinfo to retrieve compound details from csid.

Examples

1
2
3
4
5
6
7
8
## 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)

## End(Not run)

Example output

https://www.chemspider.com/Search.asmx/SimpleSearch?query=Triclosan&token=<YOUR-SECURITY-TOKEN>

[1] NA
Warning message:
In FUN(X[[i]], ...) : Problem with web service encountered... Returning NA.
https://www.chemspider.com/Search.asmx/SimpleSearch?query=Triclosan&token=<YOUR-SECURITY-TOKEN>

https://www.chemspider.com/Search.asmx/SimpleSearch?query=50-00-0&token=<YOUR-SECURITY-TOKEN>

Triclosan   50-00-0 
       NA        NA 
Warning messages:
1: In FUN(X[[i]], ...) :
  Problem with web service encountered... Returning NA.
2: In FUN(X[[i]], ...) :
  Problem with web service encountered... Returning NA.

webchem documentation built on Nov. 17, 2017, 6:05 a.m.

Related to get_csid in webchem...