R is an open-source programming language and environment with powerful and extensive features for data analysis, data visualization, and statistical computing. Although R first appeared in the 1990s, its use has recently grown considerably with the increase of interest in data analytics, for which the language is well suited. R also includes a full range of general purpose programming language features, including control structures, mathematical operations, and file input/output. This combination makes R a very effective option for implementing simulation models and analyzing their output.

In the first portion of this presentation we first provide background information on R, including its design intent, key features, and availability. In the second part we demonstrate the application of R to both research and teaching by presenting two examples of R programs from intentionally different application domains. The first example models the runoff of precipitation from a slope into a river or lake, considering spatially varying precipitation and infiltration rates across the slope. The second example models the accuracy of a single shot aimed direct fire weapon, such as a tank main gun, subject to both operator aiming and weapon dispersion errors. Target geometry is considered in determining the outcome of each shot. Both models make extensive use of R’s built-in functions for probability distribution calculations and data visualization. Both R source code and data plots generated by R will be described. In the final part of the presentation we report on our experiences using R for both research and teaching, assess its utility, and offer suggestions to researchers and instructors considering R.

This presentation will be of value to researchers considering the use of R for data analysis, visualization, and simulation, and also to instructors seeking an effective and accessible tool to teach those topics. Excellent sources for supporting R for research and teaching include the sources listed below. Although the presentation will be delivered in a conventional way, the relevance and contrast of the two examples are intended to engage the interest of the audience.

O. Jones, R. Marllardet, and A. Robinson, Introduction to Scientific Programming and Simulation Using R, Second Edition, CRC Press, Boca Raton FL, 2014.

J. Albert, R by Example, Springer, New York NY, 2012.


  • R is an open-source freely-available programming language
  • R has extensive built-in features that support data visualization and simulation
  • R can be useful and effective for both research and teaching in these areas


Mikel D. Petty, Ph.D., UAH Computer Science
Mikel D. Petty is an Associate Professor of Computer Science at the University of Alabama in Huntsville. He received a Ph.D. in Computer Science from the University of Central Florida in 1997. He has worked in modeling and simulation since 1990, especially verification and validation methods, simulation interoperability, and human behavior modeling. He has published 208 research papers and has been awarded $16.5 million in research funding. He is currently Editor-in-Chief of the scholarly journal SIMULATION: Transactions of the Society for Modeling and Simulation International. He has been dissertation advisor to seven graduated Ph.D. students in three different academic disciplines.