# might fail if Server is not available
gly <- ppdb_query('1071-83-6')
gly$approved_in
# handle multiple CAS
cas <- c('1071-83-6', '50-00-0')
# check if these compounds are approved in germany
foo <- function(y) {
# query cas
q <- ppdb_query(y)
# extract status for germany
q$approved_in$status[q$approved_in$country == 'DE']
}
sapply(cas, foo)
Run the code above in your browser using DataLab