# might fail if API is not available
cid <- get_pcid('Triclosan')
pc_compinfo(cid[1])
###
# multiple CIDS
comp <- c('Triclosan', 'Aspirin')
cids <- sapply(comp, function(x) get_pcid(x, first = TRUE))
(ll <- lapply(cids, pc_compinfo, first = TRUE))
# as mtrix
do.call(rbind, ll)
Run the code above in your browser using DataLab