R is a free software package with extensive statistical capability, customizable graphics, and both imperative and vectorized programming capabilities. For use in an introductory simulation course, the capabilities of R for analyzing simulation statistics, and for generating corresponding graphics, aid in developing student intuition. R also provides flexibility in determining whether simulation and analysis should be done using simulation code that students implement from scratch, using skeleton code which students modify, or using completed code given as a black box. These aspects of R make it a unique platform for programming and analyzing discrete-event simulations. In this paper, we present an R function named ssq which we wrote to simulate a single-server queue, and we provide several illustrations showing its use as an exemplar for using R in an introductory simulation course. All of the code to analyze the output from ssq uses functions from the base distribution of R.