molMass | R Documentation |
molMass
calculates the molar mass of any organic compound (and some salts) based on its chemical formula.
molMass(form)
form |
a chemical formula, as a character vector, e.g., |
Standard atomic weights are from CIAAW, and were rounded to three or more digits (with the exception of Li) depending on the range of the reported interval for “normal materials”.
In general form
should follow capitalization rules for elements (i.e., first letter capitalized, second lower-case).
However, if form
contains single-letter elements only, it is possible to use lower-case letters for all elements (but for clarity this is not recommended).
The function is vectorized.
Numeric vector with length equal to length of form
with molar mass (g/mol)
Charlotte Rennuit and Sasha D. Hafner
CIAAW <http://www.ciaaw.org/atomic-weights.htm>
calcCOD
molMass("C6H12O6")
molMass("CH3COOH")
molMass("CH3CH2OH")
molMass("CH4")
molMass("ch4")
molMass(c("C6H12O6", "CH3COOH", "CH3CH2OH"))
# Case-sentitive for two letter elements
molMass("NaHCO3")
# Complex formulas OK
molMass("H3C(CH2)5COOH")
molMass("(C6H12O6)0.24999 (H3COOH)0.75001")
# Database is quite complete
molMass('CdSiO3')
# Use care for, e.g., hydrates
molMass('FeSO4(H2O)7')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.