post_batch: Post a batch of ChemSpider record IDs

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RECORDS-post_batch.R

Description

Post a batch query of up to 100 ChemSpider record IDs.

Usage

1
2
3
4
5
6
7
8
post_batch(
  recordIds,
  fields = "all",
  apikey,
  id = TRUE,
  simplify_formula = FALSE,
  coerce = FALSE
)

Arguments

recordIds

A vector of integer ChemSpider IDs.

fields

A character string indicating which fields to return; see Details.

apikey

A 32-character string with a valid key for ChemSpider's API services.

id

logical: Should the id column (i.e., the recordId) be part of the output? Defaults to TRUE.

simplify_formula

logical: Should formula strings be simplified? Defaults to FALSE.

coerce

logical: should the list be coerced to a data.frame? Defaults to FALSE.

Details

"The available fields are: SMILES, Formula, InChI, InChIKey, StdInChI, StdInChIKey, AverageMass, MolecularWeight, MonoisotopicMass, NominalMass, CommonName, ReferenceCount, DataSourceCount, PubMedCount, RSCCount, Mol2D, Mol3D."

If a recordId is not found, it is silently dropped.

Value

A data frame (if multiple fields are returned), or a vector of adequate type if only one field is required.

Author(s)

Raoul Wolf (https://github.com/RaoulWolf/)

See Also

https://developer.rsc.org/compounds-v1/apis/post/records/batch

Examples

1
2
3
4
5
6
7
## Not run: 
## Post a query for the first 50 ChemSpider entries.
recordIds <- 1:50
apikey <- "a valid 32-character ChemSpider apikey"
post_batch(recordIds = recordIds, apikey = apikey)

## End(Not run)

NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.