Learn R Programming

InterpretMSSpectrum (version 1.4.5)

CountChemicalElements: CountChemicalElements.

Description

CountChemicalElements will split a character (chemical formula) into its elements and count their occurrence.

Usage

CountChemicalElements(x = NULL, ele = NULL)

Value

A named numeric with counts for all contained or specified elements.

Arguments

x

Chemical formula.

ele

Character vector of elements to count particularly or counting all contained if NULL.

Details

No testing for any chemical alphabet is performed. Elements may occur several times and will be summed up in this case without a warning.