Skip to content

Need to Write a Code that can find the molecular weight of various compounds

4 messages · H. Paul Benton, matthew.ttd.nguyen

#
Hi Paul! Thanks a lot!

I tried downloading the Rdisop file and encountered this error:

Error: package ?Rdisop? is not installed for 'arch=x64'

I tried downloading directly from the source using R and got this error:

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
  cannot open: HTTP status was '404 Not Found'

So i'm not sure if the source is still there?

I also tried the Rcdk method, and received this error: 
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry
Error: package ?rJava? could not be loaded

So! I downloaded Java and the newest rJava package from
http://www.rforge.net/rJava/
But still received this error:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry
Error: package/namespace load failed for ?rJava?

any ideas? ):

--
View this message in context: http://r.789695.n4.nabble.com/Need-to-Write-a-Code-that-can-find-the-molecular-weight-of-various-compounds-tp4342874p4352295.html
Sent from the R help mailing list archive at Nabble.com.
#
I also tried downloading the JDK version of Java and received this new error
when running it:

Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: dirname(this$RuntimeLib)
  error: a character vector argument expected
Error: package/namespace load failed for ?rJava?

--
View this message in context: http://r.789695.n4.nabble.com/Need-to-Write-a-Code-that-can-find-the-molecular-weight-of-various-compounds-tp4342874p4352510.html
Sent from the R help mailing list archive at Nabble.com.
4 days later
#
Thanks Paul,

I was trying to get the function for getMass to input into another column
into a data set using R code: 

FakeCompounds$Molecule <- with(FakeCompounds, 
  getMolecule(Molecular.Formula))
showData(FakeCompounds, placement='-20+200', font=getRcmdr('logFont'), 
  maxwidth=80, maxheight=30)
FakeCompounds$Molecular.Mass <- with(FakeCompounds, 
  getMass(Molecular.Formula))

which gave me the response error: [24] ERROR:  $ operator is invalid for
atomic vectors

Which I didn't quite understand in the context of Rdisop, does it only allow
for one variable at a time?

So I tried to create a loop, ending up with: 

c(getFormula(getMolecule("CH3")),getFormula(getMolecule("CH2")))->B
i<-1
for (i in 1:length(B)){G[i]<-getMass(B[i])}

but I still get the same error: [25] ERROR:  $ operator is invalid for
atomic vectors

The final goal is to have a list that can calculate molecular mass from a
list of chemical formulas.

Any help? I'm not sure if this is a problem only related to Rdisop or not.
Thanks a lot!
Matt

--
View this message in context: http://r.789695.n4.nabble.com/Need-to-Write-a-Code-that-can-find-the-molecular-weight-of-various-compounds-tp4342874p4365836.html
Sent from the R help mailing list archive at Nabble.com.