[R] Need to Write a Code that can find the molecular weight of various compounds
    hpbenton 
    hpbenton at scripps.edu
       
    Tue Jan 31 03:58:44 CET 2012
    
    
  
Matthew,
I would try first looking at the Rcdk package. From it sound like what you 
want to do they already have some very efficient code to that. If you don't 
want all of CDK then you could try Rdisop from Bioconductor. The package 
will take a formula and give you it's mass. It won't do a matrix but just 
'sapply' the function.
http://cran.r-project.org/web/packages/rcdk/index.html
http://www.bioconductor.org/packages/2.6/bioc/vignettes/Rdisop/inst/doc/Rdisop.pdf
## code from above link##
 
library(Rdisop)
> molecule <- getMolecule("C2H5OH")
> getFormula(molecule)
[1] "C2H6O" 
> getMass(molecule)
[1] 46.04186 
    
    
More information about the R-help
mailing list