| get_pug_rest | R Documentation |
This function sends a request to the PubChem PUG REST API to retrieve various types of data for a given identifier. It supports fetching data in different formats and allows saving the output.
get_pug_rest(
identifier = NULL,
namespace = "cid",
domain = "compound",
operation = NULL,
output = "JSON",
searchtype = NULL,
property = NULL,
options = NULL,
save = FALSE,
dpi = 300,
path = NULL,
file_name = NULL,
...
)
identifier |
A vector of identifiers for the query, either numeric or character.
The type of identifier depends on the |
namespace |
A character string specifying the namespace for the request. Possible values include: - - - - - - - For more details, see the PUG REST API documentation. |
domain |
A character string specifying the domain for the request. Possible values include: - - - For more details, see the PUG REST API documentation. |
operation |
An optional character string specifying the operation for the request. Possible values depend on the Examples include: - - - - - If For a full list of operations, see the PUG REST API documentation. |
output |
A character string specifying the output format. Possible values are: - - - - - - - For more details, see the PUG REST API documentation. |
searchtype |
An optional character string specifying the search type. Possible values include: - - - If For more details, see the PUG REST API documentation. |
property |
An optional character string specifying the property or properties to retrieve. This is typically used when Examples include: - - - - - If For a full list of properties, see the Compound Property Tables. |
options |
A list of additional options for the request. Available options depend on the specific request and the API. Examples include: - For similarity searches: - For substructure searches: If For more details, see the Structure Search Operations section of the PUG REST API. |
save |
A logical value indicating whether to save the output as a file or image.
Default is |
dpi |
An integer specifying the DPI for image output when |
path |
A character string specifying the directory path where the output file will be saved if |
file_name |
A character string specifying the name of the file (without file extension) to save.
If |
... |
Additional arguments passed to the underlying HTTP request functions. |
For more information on the possible values for parameters such as namespace, domain, operation,
output, searchtype, and property, please refer to the
PUG REST API documentation.
An object of class ''PugRestInstance'' containing:
Logical value indicating if the request was successful.
If 'success' is 'FALSE', a list containing error messages.
The content retrieved from the API; format depends on 'output'.
A list of the arguments used in the request.
If 'save' is 'TRUE', details about the saved file.
result <- get_pug_rest(identifier = "2244", namespace = "cid", domain = "compound", output = "JSON")
pubChemData(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.