R is a programming language designed primarily for data manipulation, calculations, and graphics. An R script is text file that contains a function (a sequence of commands) that, when executed, returns a useful output, such as the result of a sequence of calculations or a visualization of data. An R package is a collection of functions, data (where appropriate), help files, and (ideally) vignettes that demonstrate the package's capabilities. The packages listed here are fully developed and available through CRAN or GitHub.
titrationCurves. This package is a collection of functions to plot acid/base titration curves (pH vs. volume of titrant), complexation titration curves (pMetal vs. volume of EDTA), redox titration curves (potential vs. volume of titrant), and precipitation titration curves (either pAnalyte or pTitrant vs. volume of titrant). Options include the titration of mixtures, the ability to overlay two or more titration curves, and the ability to show equivalence points.
eChem. This package includes functions to simulate and to visualize four types of electrochemistry experiments: two potential step experiments (chronoamperometry and chronocoulometry, both with options for single pulse and double pulse experiments), and two potential scan experiments (linear-sweep voltammetry, with and without stirring, and cyclic voltammetry). Each simluation allows for an initial oxidation reaction or an initial reduction reaction, and allows for a single preceding or a single following chemical step, where Z is a non-electroactive species. The linear sweep voltammetry, cyclic voltammetry, and chronoamperomety simulations use the explicit finite difference computational method outlined in Gosser, D. K. Cyclic Voltammetry Simulation and Analysis of Reaction Mechanisms, VCH, New York, 1993, and in Brown, J. H. “Development and Use of a Cyclic Voltammetry Simulator to Introduce Undergraduate Students to Electrochemical Simulations” J. Chem. Educ., 2015, 92, 1490–1496; chronocoulometry simulations are completed by integrating the result of the corresponding chronoamperometry experiment. Although Gosser’s and Brown’s treatements are developed to simulate cyclic voltammetry experiments, their approach is easy to generalize to other diffusion-controlled electrochemistry experiments.
The following materials are under development and their titles are shared here with minimimal descriptions and without instructor guides. Links to the code are provided, however, these are works in progress and there is no guarantee that the code is fully functional.
equilibrium diagrams. Functions for drawing alpha plots and ladder diagrams for systems of weak acids and weak bases, and ladder diagrams for metal-ligand complexation and for redox systems.
equilibrium templates. Examples of templates for modeling acid-base, solubility, complexation, and surface absorption equilibrium systems. The scripts are organized into sections that define the system. To use a template, replace the code in each section with code appropriate for the system you wish to model.
Using R to Introduce Students to PCA, CA, and MLR. Data and scripts used to generate figures for the presentation "Using R to Introduce Students to Principal Component Analysis, Cluster Analysis, and Multiple Linear Regression," presented at Pittcon 2018.
To use the scripts and packages gathered here, you need to install R on your computer, which is available as Free Software under a GNU General Public License, and is available for Linux, MacOS, and Windows operating systems. To install R, first go the website www.r-project.org and click on the link to CRAN on the left side of the page under the heading "Downloads." Scroll through the list of CRAN mirror sites and click on a link to a site located in your region. Select the link in the "Download and Install R" box at the top of the page that is appropriate for your operating system and follow the directions. To install a package, launch R and type install.packages("package name") at the command prompt; this will download and install the Shiny package and, ideally, other required packages. Installing a package does not make the package immediately available to you; to make the package available any R session, type load("package name") at the command prompt.