add.formula {RMassBank} | R Documentation |
Add, subtract, and multiply molecular formulas.
add.formula(f1, f2, as.formula = TRUE, as.list = FALSE) multiply.formula(f1, n, as.formula = TRUE, as.list = FALSE)
f1, f2 |
Molecular formulas (in list form or in text form) to calculate with. |
as.formula |
Return the result as a text formula (e.g.
|
as.list |
Return the result in list format (e.g. |
n |
Multiplier (positive or negative, integer or non-integer.) |
Note that the results are not checked for plausibility at any stage, nor reordered.
The resulting formula, as specified above.
Michael Stravs
formulastring.to.list
, is.valid.formula
,
order.formula
## add.formula("C6H12O6", "C3H3") add.formula("C6H12O6", "C-3H-3") add.formula("C6H12O6", multiply.formula("C3H3", -1))