From pinard at iro.umontreal.ca  Sat Jun  3 04:56:12 2006
From: pinard at iro.umontreal.ca (pinard at iro.umontreal.ca)
Date: Sat,  3 Jun 2006 04:56:12 +0200 (CEST)
Subject: [Rd] Irregularity in stem() display (PR#8934)
Message-ID: <20060603025612.CCAD7CA6D@slim.kubism.ku.dk>

Hi, R people.

Consider the following small R session:

======================================================================>
> a <- c(8.48, 9.58, 9.96)
> stem(a)

  The decimal point is at the |

  8 |
  8 | 5
  9 |
  9 | 6
  10 | 0

> stem(round(a,1))

  The decimal point is at the |

   8 | 5
   9 |
   9 | 6
  10 | 0

======================================================================<

As the output of ?stem is rather vague about the format of its output,
some may question whether we have bugs here, or not.  If not, let's
call what follows mere "suggestions for improvement" :-).

The vertical bars are aligned in the second case while they are not in
the first.  Would not they be nicer if always aligned?

Also, while "scale=" could adjusted to elongate or compress the result,
the scale is meant to be applied over the "default" scale, the meaning
of which is not defined in ?stem.  The default scale seemingly uses more
lines than really required.  Maybe this default could be improved?

Here is another strangety about stem():

======================================================================>
> stem(2)
> stem(c(2, 2))

  The decimal point is at the |

  2 | 00

======================================================================<

That is, a single value is not reported, while it probably should.

--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = Under development (unstable)
 major = 2
 minor = 4.0
 year = 2006
 month = 06
 day = 01
 svn rev = 38258
 language = R
 version.string = R version 2.4.0 Under development (unstable) (2006-06-01 r38258)

Locale:
LC_CTYPE=fr_CA.UTF-8;LC_NUMERIC=C;LC_TIME=fr_CA.UTF-8;LC_COLLATE=fr_CA.UTF-8;LC_MONETARY=fr_CA.UTF-8;LC_MESSAGES=fr_CA.UTF-8;LC_PAPER=fr_CA.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=fr_CA.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base

-- 
Fran??ois Pinard   http://pinard.progiciels-bpi.ca



[Rd] Irregularity in stem() display (PR#8934)
pinard at iro.umontreal.ca