Does the stem function in R handle large counts correctly?

Viewed 25

I am wondering if the stem function in R is producing the stem and leaf plot correctly for this example. The code

X <- c(rep(1,1000),2:15)
stem(X,width = 20)

produces the output

  The decimal point is at the |

   1 | 00000000+980
   2 | 0
   3 | 0
   4 | 0
   5 | 0
   6 | 0
   7 | 0
   8 | 0
   9 | 0
  10 | 0
  11 | 0
  12 | 0
  13 | 0
  14 | 0
  15 | 0

There are 1000 ones in the data, but the output of the stem function seems to indicate that there are 988 ones (if you count the zeros in the first row and add 980). Instead of +980, I think it should display +992 at the end of the first row.

Is there an error in the stem function or am I not reading the output correctly?

0 Answers
Related