countElements
parses strings representing a chemical formula into a named
vector of element counts.
Arguments
- x
character()
representing a chemical formula.
Examples
countElements(c("C6H12O6", "C11H12N2O2"))
#> $C6H12O6
#> C H O
#> 6 12 6
#>
#> $C11H12N2O2
#> C H N O
#> 11 12 2 2
#>