Learn R Programming

PubChemR (version 3.0.0)

pc_substance: Query Substance Records via the Next-Generation API

Description

Convenience wrapper around `pc_request()` for `substance` domain retrieval.

Usage

pc_substance(
  identifier,
  namespace = "sid",
  operation = "record",
  output = "JSON",
  options = NULL,
  ...
)

Value

A typed `PubChemRecord` object.

Arguments

identifier

Identifier(s).

namespace

PubChem namespace.

operation

Operation.

output

Output format.

options

Named list of query options.

...

Additional arguments forwarded to `httr::RETRY`.

Details

The function returns a typed record object without altering payload shape, making it suitable for downstream custom parsers.

Examples

Run this code
sub_rec <- pc_substance(5360534, offline = TRUE)
inherits(sub_rec, "PubChemRecord")

if (FALSE) {
pc_substance(5360534)
}

Run the code above in your browser using DataLab