CDK-R / cdkr

Integrating R and the CDK
https://cdk-r.github.io/cdkr/
42 stars 27 forks source link

Fail safely on empty lists #1

Closed egonw closed 13 years ago

egonw commented 13 years ago

Rajarshi,

loading the Fragments2.sdf from the Bioclipse sample data causes and empty list to be returned by your rcdk Java wrapper, causing an error in your R code:

Error in which(unlist(lapply(molecules, is.jnull))) : argument to 'which' is not logical

While the reading of that SD file is still broken, at least it fails safely now, and just returns an empty list.

rajarshi commented 13 years ago

Thank - I've merged your patch. However when I loaded the Fragments2.sdf file, I got 5 molecules. Did you not get 5?

egonw commented 13 years ago

No. A zero length list.

rajarshi commented 13 years ago

Hmm, strange. Anyway, try the version from Github. Should work fine now