Learn R Programming

webchem (version 1.1.1)

cs_img: Download images from ChemSpider

Description

Retrieve images of substances from ChemSpider and export them in PNG format.

Usage

cs_img(csid, dir, overwrite = TRUE, apikey = NULL, verbose = TRUE)

Arguments

csid

numeric; the ChemSpider ID (CSID) of the substance. This will also be the name of the image file.

dir

character; the download directory. dir accepts both absolute and relative paths.

overwrite

logical; should existing files in the directory with the same name be overwritten?

apikey

character; your API key. If NULL (default), cs_check_key() will look for it in .Renviron or .Rprofile.

verbose

logical; should a verbose output be printed on the console?

References

https://developer.rsc.org/compounds-v1/apis

See Also

get_csid, cs_check_key

Examples

Run this code
# NOT RUN {
cs_img(c(582, 682), dir = tempdir())
# }

Run the code above in your browser using DataLab