getPubchemCompound | R Documentation |
This function retrieves compound information from PubChem using the PubChem REST API. Used by other functions to retrieve compound information.
getPubchemCompound(
ids,
from = "cid",
to = "property",
properties = c("Title", "InChIKey"),
raw = FALSE,
query_only = FALSE,
output = "JSON",
...
)
ids |
A vector of compound identifiers. |
from |
The source namespace of the compound identifiers. Default is 'cid'. |
to |
The target namespace for the compound information. Default is 'property'. |
properties |
A character vector specifying the properties to retrieve. |
raw |
Logical indicating whether to return the raw query results. Default is FALSE. |
query_only |
Logical indicating whether to only perform the query without retrieving the results. Default is FALSE. |
output |
The format of the query results. Default is 'JSON'. |
... |
Additional arguments to be passed to the query_pubchem_rest function. |
A data.table containing the retrieved compound information.
properties <- c("Title", "MolecularFormula", "InChIKey", "CanonicalSMILES")
getPubchemCompound(c(3672, 176870), from = "cid", to = "property", properties = properties)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.