R/99_check_functions.R
    check_chemical_formula.RdThis function checks whether a given chemical formula is valid based on standard conventions. It ensures that element symbols are followed by valid numeric subscripts (if present). The function uses a list of known chemical elements up to 2022. It returns TRUE if the formula is valid, otherwise returns FALSE.
check_chemical_formula(formula)A logical value: TRUE if the formula is valid, FALSE otherwise.
check_chemical_formula("H2O") # TRUE
#> [1] TRUE
check_chemical_formula("2H") # FALSE
#> [1] TRUE