get_recordId_image: Get a PNG image of a ChemSpider record

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

View source: R/RECORDS-get_recordId_image.R

Description

This function is used to obtain a 250 x 250 pixel PNG image file of a ChemSpider record ID, e.g., after chemspiderapi::get_queryID_results().

Usage

1
get_recordId_image(recordId, apikey, decode = FALSE, simplify = FALSE)

Arguments

recordId

A valid (integer) ChemSpider ID.

apikey

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

decode

logical: should the base64-encoded image be decoded? Defaults to FALSE.

simplify

logical: should the results be simplified to a vector? Defaults to FALSE.

Details

Returns a numeric (double) array. To save the picture, see the vignette "Saving PNG Images of Chemicals".

Value

A numeric array.

Author(s)

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

See Also

https://developer.rsc.org/compounds-v1/apis/get/records/{recordId}/image

Examples

1
2
3
4
5
6
7
## Not run: 
## Get the PNG image for caffeine
recordId <- 2424L
apikey <- "a_valid_ChemSpider_API_key"
get_recordId_image(recordId = recordId, apikey = apikey)

## End(Not run)

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