chemboxR
is a package for molecular information calculator based on
empirical formulas of chemicals in raw text. It is designed to
intelligently process text input containing the chemical formula and
provide associated information on the inquired molecule. It is able to
provide the molar mass, check a formula’s validity, and provide a
balanced combustion equation if the input is combustible. This tool can
be utilized for various educational and research purposes for simple and
fast information retrieval.
You can install the development version of chemboxR from GitHub with:
# install.packages("devtools")
devtools::install_github("UBC-MDS/chemboxR")
The package includes 4 functions for solving chemistry problems:
-
get_elements
a parser that takes a chemical formula in string format and returns a dictionary that contains the elements and their respective count. -
is_valid
: a checker that returns a boolean indicating whether a given input is chemically reasonable. -
get_molec_props
: a method that takes a chemical formula in string format and returns a dataframe with various useful properties of each element in the formula. -
get_combustion_equation
: a method that takes a text chemical formula that only contains carbon (C
) and hydrogen (H
) and outputs a balanced equation resulting from combustion.
In order to be able to perform some of the functions above, a dataset will need to be used that contains various atomic properties of the elements in the periodic table. The data can be found in the Chembox repo here which was sourced from here. Please note that we do not take credit for the dataset, it is merely for use with our functions.
A similar package chemr is available online that employs a similar string-parsing design and molar mass calculation. Additionally, they have string-parsing for chemical reactions implemented.
What we do differently:
-
We support validity checks for unambiguous acids, bases and salts.
-
We include methods specifically for automated combustion equation generation and balancing.
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
chemboxR
is licensed under the terms of the MIT license.
The contributors of this project are Wilfred Hass, Vikram Grewal, Luke Yang, and Nate Puangpanbut.