Learn R Programming

PubChemR (version 3.0.0)

pc_submit: Submit an Asynchronous PubChem Query

Description

Submits a potentially asynchronous PubChem request and returns a query object containing the initial response and listkey metadata.

Usage

pc_submit(
  domain = "compound",
  namespace = "cid",
  identifier = NULL,
  operation = NULL,
  searchtype = NULL,
  output = "JSON",
  options = NULL,
  ...
)

Value

An object of class `PubChemAsyncQuery`.

Arguments

domain

PubChem domain.

namespace

PubChem namespace.

identifier

Identifier(s).

operation

Operation.

searchtype

Search type.

output

Output format.

options

Named list of query options.

...

Additional arguments forwarded to `httr::RETRY`.

Details

If PubChem responds with a waiting payload, `listkey` is captured and can be polled later using `pc_poll()` or `pc_collect()`.

Examples

Run this code
q <- pc_submit(identifier = 2244, offline = TRUE)
inherits(q, "PubChemAsyncQuery")

if (FALSE) {
pc_submit(identifier = 2244)
}

Run the code above in your browser using DataLab