Hello,
In the package IsoSpecR
, the first argument is of the function IsoSpecify
is molecule = molecule = c(C=10,H=22,O=1, N=22)
; a named vector.
I need to apply this function over many set of values, but I have my data as a dataframe.
mydata1 <- data.frame(C= c(10,2,6), H= c(5,12,1), O= c(2,1,1), N= c(22,22,1))
I have also my data as follows:
mydata2 <- data.frame(iso = c("C= 10, H= 5, O=2, N=22", "C= 2, H= 12, O= 1, N=22", "C= 6, H= 1, O= 1, N=1"))
if I want to use map function:
map(mydata, IsoSpecify( molecule = .x , stopCondition = .9999 )
or a for loop:
for i in seq_along(iso){
res [[i]] <- IsoSpecify(molecule = data[[i]], stopCondition = .9 )
print(res)
}
I get the following error:
Error in Rinterface(molecule = molecule[molecule > 0], isotopes = isotopes, :
Not compatible with STRSXP: [type=NULL].
Any input would be helpful. Thank you.