order.formula {RMassBank} | R Documentation

## Order a chemical formula correctly

### Description

Orders a chemical formula in the commonly accepted order (CH followed by alphabetic ordering).

### Usage

    order.formula(formula, as.formula = TRUE, as.list = FALSE)

### Arguments

`formula` | A molecular formula in string or list representation (`"C6H6"` or `list(C=6,H=6)`).
`as.formula` | If `TRUE`, the return value is returned as a string. This is the default.
`as.list` | If `TRUE`, the return value is returned in list representation.

### Author(s)

Michele Stravs

### See Also

`list.to.formula`, `add.formula`, `is.valid.formula`

### Examples

    #
    order.formula("H4C9")
    order.formula("C2N5HClBr")

[Package RMassBank version 2.12.0 Index]