[Rd] stem plot problem with the mtcars data (PR#6453)

lianglim at stt.msu.edu lianglim at stt.msu.edu
Thu Jan 22 19:22:10 MET 2004


Full_Name: Liming Liang
Version: 1.8.1
OS: windows2000 professional
Submission from: (NULL) (67.172.81.139)


I was looking at the variable 'mpg' of the data file 'mtcars' and make a stem
plot, the following is the commend I entered. The stem plot shows the largest
observation is 32.9 but actually in the data the largest observation is 33.9,
here might be a problem.

> data(mtcars)
> stem(mtcars$mpg)

  The decimal point is at the |

  10 | 44
  12 | 3
  14 | 3702258
  16 | 438
  18 | 17227
  20 | 00445
  22 | 88
  24 | 4
  26 | 03
  28 | 
  30 | 44
  32 | 49

> mtcars$mpg
 [1] 21.0 21.0 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 17.8 16.4 17.3 15.2 10.4
[16] 10.4 14.7 32.4 30.4 33.9 21.5 15.5 15.2 13.3 19.2 27.3 26.0 30.4 15.8 19.7
[31] 15.0 21.4
> max(mtcars$mpg)
[1] 33.9

Liming Liang
Dept of Statistics and Probability
Michigan State University



More information about the R-devel mailing list