Learn R Programming

PubChemR (version 3.0.0)

get_substances: Retrieve Substances from PubChem

Description

This function sends a request to PubChem to retrieve substance data based on the specified parameters.

Usage

get_substances(identifier, namespace = "sid", operation = NULL, options = NULL)

Value

An object of class 'PubChemInstanceList' containing all the substance information of requested compounds.

Arguments

identifier

A vector of substance identifiers, either numeric or character.

namespace

A character string specifying the namespace of the identifier.

operation

A character string specifying the operation to perform.

options

A list of additional options for the request.

Details

For more detailed information, please refer to the PubChem PUG REST API documentation.

Examples

Run this code
# \donttest{
subs <- get_substances(
  identifier = c("aspirin", "ibuprofen"),
  namespace = "name"
)

instance(subs, "aspirin")
retrieve(instance(subs, "aspirin"), "source")
# }

Run the code above in your browser using DataLab