mass: molecular mass

View source: R/mass.R

massR Documentation

molecular mass

Description

calculate accurate molecular mass

Usage

mass(F, caseSensitive = FALSE)

Arguments

F

chemical formula, case insensitive

caseSensitive

if case sensitive is 'FALSE' (default), the elements are seperated by numbers. for instance, Carbon dioxyde can be written as 'c1o2' or any combination of the two elements in lower or upper cases. However, the number of elements should be clearly stated in the chemical formula. if case sensitive is 'TRUE', the elements are seperated by upper case letters. For instance, Carbon dioxyde must be written as 'C1O2' or ‘CO2'. You don’t meed to write the number of the element if it is 1.

Author(s)

Yonghui Dong

Examples

 mass('C7h7o1')
 mass('C7H7O', caseSensitive = TRUE)
 mass(c('C7H7O4', 'C'), caseSensitive = TRUE) # vector input
 mass(c('c7h7O4', 'c1'))

MSbox documentation built on Dec. 8, 2022, 5:10 p.m.