Calculate the mass of a molecular formula.

get_mass(x, ...)

# S3 method for mol_form
get_mass(x, mass_set = "average", ...)

Arguments

x

Vector of molecular formulas whose masses should be calculated.

...

Other arguments passed on to individual methods.

mass_set

Atomic masses that should be used for mass calculation. Either a string specifying a predefined mass set ("average", average atomic masses as defined by IUPAC; "monoisotopic", masses of the most abundant isotope of each element), or a variable containing a custom mass set defined by new_mass_set().

Value

A double vector representing the molecular masses (in dalton).

See also

new_mass_set() for defining custom mass sets, atomic_masses for predefined mass sets

Examples

molecular_formula("C6 H10 O5") %>% get_mass()
#> [1] 162.141
molecular_formula("C6 H10 O5") %>% get_mass("monoisotopic")
#> [1] 167.0528