This function checks whether a given adduct formula is valid by comparing it to known valid adducts. It returns TRUE if the adduct formula is valid, otherwise returns FALSE.

check_adduct_formula(adduct)

Arguments

adduct

A character string representing the adduct formula to be validated.

Value

A logical value: TRUE if the adduct formula is valid, FALSE otherwise.

Examples

check_adduct_formula("(M+H)+") # TRUE
#> [1] TRUE
check_adduct_formula("(M+X)+") # FALSE
#> [1] TRUE