get_csid | R Documentation |
Query one or more compunds by name, formula, SMILES, InChI or InChIKey and return a vector of ChemSpider IDs.
get_csid(
query,
from = c("name", "formula", "inchi", "inchikey", "smiles"),
match = c("all", "first", "ask", "na"),
verbose = getOption("verbose"),
apikey = NULL,
...
)
query |
character; search term. |
from |
character; the type of the identifier to convert from. Valid
values are |
match |
character; How should multiple hits be handled?, "all" all matches are returned, "best" the best matching is returned, "ask" enters an interactive mode and the user is asked for input, "na" returns NA if multiple hits are found. |
verbose |
logical; should a verbose output be printed on the console? |
apikey |
character; your API key. If NULL (default),
|
... |
furthrer arguments passed to |
Queries by SMILES, InChI or InChiKey do not use cs_control
options. Queries by name use order_by
and order_direction
.
Queries by formula also use datasources
. See cs_control()
for
a full list of valid values for these control options.
formula
can be expressed with and without LaTeX syntax.
Returns a tibble.
An API key is needed. Register at https://developer.rsc.org/ for an API key. Please respect the Terms & conditions: https://developer.rsc.org/terms.
https://developer.rsc.org/docs/compounds-v1-trial/1/overview
Eduard Szöcs, Tamás Stirling, Eric R. Scott, Andreas Scharmüller, Ralf B. Schäfer (2020). webchem: An R Package to Retrieve Chemical Information from the Web. Journal of Statistical Software, 93(13). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v093.i13")}.
## Not run:
get_csid("triclosan")
get_csid(c("carbamazepine", "naproxene","oxygen"))
get_csid("C2H6O", from = "formula")
get_csid("C_{2}H_{6}O", from = "formula")
get_csid("CC(O)=O", from = "smiles")
get_csid("InChI=1S/C2H4O2/c1-2(3)4/h1H3,(H,3,4)", from = "inchi")
get_csid("QTBSBXVTEAMEQO-UHFFFAOYAR", from = "inchikey")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.