#| include = FALSE knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
A ZeroPM R package
The goal of the cccapi package is to provide a minimal and lightweight interface to the CAS Common Chemistry API services. To get access to the API services, you need to register at https://www.cas.org/services/commonchemistry-api.
The dependencies of cccapi are kept at a bare minimum: curl for handling the API requests and jsonlite to parse data from JSON format.
You can install the development version of cccapi from GitHub with:
#| eval = FALSE # install.packages("remotes") remotes::install_github("ZeroPM-H2020/cccapi")
The following examples show the functionality of the three API functions of
cccapi: get_detail()
, get_export()
, and get_search()
.
This is an example which shows you how to get the record details for a CAS Registry Number. In this case, for atrazine:
library(cccapi) atz_det <- get_detail("1912-24-9") str(atz_det)
Here is an example which shows you how to get the MOL file for a CAS Registry Number. In this case, again, for atrazine:
atz_exp <- get_export("1912-24-9") str(atz_exp)
And finally, here is an example which shows you how to search for CAS Registry
Numbers with a partial name. See ?get_search
for details on the available
search options!
atz_src <- get_search("atrazin*") str(atz_src)
This R package was developed by the EnviData initiative at the Norwegian Geotechnical Institute (NGI) as part of the project ZeroPM: Zero pollution of Persistent, Mobile substances. This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101036756.
If you find this package useful and can afford it, please consider making a donation to a humanitarian non-profit organization, such as Sea-Watch. Thank you.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.