View source: R/molform_functions.R
as.molform | R Documentation |
This function generates a molecular formula object.
as.molform(MolForm)
MolForm |
A molecular formula written as a string like "C6H12O6". Only elements up to uranium are supported. |
A list of length 92 (Hydrogen to Uranium) is stored in the attributes and used for quick mathematics. All numerics are rounded to the nearest whole number.
## Not run:
# Generate a molecular formula object
as.molform("C6H12O6")
# Duplicates should be added
as.molform("CHCO3")
# This should fail, as 'Ot' and 'Lp' are not elements
as.molform("C6H12Ot5Lp2")
# Negative elements are allowed (useful for modifications where elements are lost)
as.molform("H-3N-1")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.