# NOT RUN {
# might fail if API is not available
y1 <- ci_query('50-00-0', from = 'rn', match = 'first')
y1[['50-00-0']]$inchikey
# query by inchikey
y2 <- ci_query('WSFSSNUMVMOOMR-UHFFFAOYSA-N', from = 'inchikey')
y2[[1]]$name
# query multiple compounds
comps <- c("50-00-0", "64-17-5")
y3 <- ci_query(comps, from = "rn")
# extract log-P
sapply(y3, function(y){
if (length(y) == 1 && is.na(y))
return(NA)
y$physprop$Value[y$physprop$`Physical Property` == 'log P (octanol-water)']
})
# }
Run the code above in your browser using DataLab