The R function
stem from the
base package and
aplpack are fundamental for our purpose to create the stem-and-leaf plots. We will illustrate these two functions for the examples discussed earlier.
> stem(x) The decimal point is 1 digit(s) to the right of the | 1 | 23 2 | 257 3 | 4 | 26 5 | 2
To obtain the median from the stem display we proceed as follows. Remove one point each from either side of the display. First we remove
12, and then remove
13. The trick is to proceed until we are left with either one point, ...