0
votes

I have a list of integers x1 within 80 and 100.

x=round(runif(100, min=80, max=100)) X1

However when I try to plot the stem and leaf plot. It seems R treats them as 91.0, 81.0 etc..

stem(x)

x2

The desired output should be only one number on the left. desired output

I have tried stem(x1/10), stem(x1, scale=1/2/3) and stem(trunc(x1)) But none of them worked.

1
please avoid adding screenshot of code, and instead copy the code itself that we will be able to help youDavid

1 Answers

0
votes

This is not an issue of integer vs. double. The issue is that the range of values is too small to create a big enough stem-and-leaf plot with the second digit.

You can simply change the tolerance to get the result you want, by simply passing a value for atom:

stem(x1,atom=10)

The output is:

  The decimal point is 1 digit(s) to the right of the |

   8 | 0000111122222333444
   8 | 555666666777778888999999999
   9 | 000111122223333444444
   9 | 55556666666677777788888999999
  10 | 0000