Skip to content

Instantly share code, notes, and snippets.

@rajarshi
Created August 25, 2017 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajarshi/c1551b81cb29d8f3629305d149bff3bd to your computer and use it in GitHub Desktop.
Save rajarshi/c1551b81cb29d8f3629305d149bff3bd to your computer and use it in GitHub Desktop.
library(dplyr)
library(rcdk)
all_form <- expand.grid(C=1:5, N=0:5, O=0:5, H=0:50)
all_form <- all_form %>%
mutate(formula = paste0('C',C,'N',N,'O',O,'H',H))
system.time(valid <- sapply(all_form$formula, function(x) isvalid.formula(get.formula(x))))
table(valid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment