Skip to contents

LEWIS molecular formula valence test and SENIOR test for the existence of molecular graphs.

Usage

lewis(
  element_frequencies,
  valences = list(C = 4, H = 1, N = 3, O = 2, P = 3, S = 4)
)

senior(
  element_frequencies,
  valences = list(C = 4, H = 1, N = 3, O = 2, P = 3, S = 4)
)

Arguments

element_frequencies

table of element frequencies for a set of molecular formulas as returned by elementFrequencies().

valences

named list of element valences

Value

Boolean vector of check results for each molecular formula.

Examples

element_frequencies <- elementFrequencies(c('C12H22O11','C12H22NO11'))
lewis(element_frequencies)
#> [1]  TRUE FALSE
senior(element_frequencies)
#> [1]  TRUE FALSE