[R] Stem and leaf display?
Peter Wolf
s-plus at wiwi.uni-bielefeld.de
Thu Jul 17 10:49:52 CEST 2003
Some weeks ago I wrote a function to construct a stem-and-leaf-display
because we want to have some more parameters to control the result.
D.Trenkler remind me of
/Velleman/Hoaglin: ABC of EDA, page 15: "It is easy to construct a
Stem-and-Leaf-Display by hand...
It is not nearly as easy to write a general computer program to produce
Stem-and-Leaf-Displays./"
so the programming was a great challange also.
Here is the link to the code:
http://www.wiwi.uni-bielefeld.de/~wolf/software/mystem/ms.sch
German documentation:
http://www.wiwi.uni-bielefeld.de/~wolf/software/mystem/ms.ps
http://www.wiwi.uni-bielefeld.de/~wolf/software/mystem/ms.html
Syntax of stem.leaf
##################################################################
#Description: #
# stem.leaf produces a stem-and-leaf-display of a data set #
# #
#Usage: #
# stem.leaf(data) #
# stem.leaf(data,unit=100,m=5,Min=50,Max=1000,rule.line="Dixon"#
# #
#Arguments: #
# data: vector of input data #
# unit: unit of leafs in: { ...,100,10,1,.1,.01,... } #
# m: 1, 2 or 5 -- 10/m=number of possible leaf digits #
# Min: minimum of stem #
# Max: maximum of stem #
# rule.line: = "Dixon" => number of lines <- 10*log(n,10) #
# = "Velleman" => number of lines <- 2*sqrt(n) #
# = "Sturges" => number of lines <- 1 + log(n,2) #
# style: = "UREDA" => UREDA like stem ( m = 2, 5 ) #
# #
#Author: #
# Peter Wolf 05/2003 #
##################################################################
Hope it helps
Peter Wolf
Richard A. O'Keefe wrote:
>I would like to do some fairly basic stem-and-leaf displays in R.
>I am aware (I might even say painfully aware) of stem(base) and
>have tried it. That's why I'm hoping someone has a usable stem-
>and-leaf display for R so that I don't have to write my own.
>
>r-project.org > Search > R Site Search > "stem and leaf display"
>finds nothing.
>
>I also tried the mail archive search, but couldn't figure out how
>to search the bodies of the messages.
>
>For the record, there are some less important things that I would
>like to have (like depths and outlier lines), and it is a pity that
>the "atom" argument of stem() is effectively undocumented (it's a
>tolerance, fine, but what _of_ and how used?), but I'd put up with
>stem() the way it is if only it didn't do things like displaying
>5.67 and 5.78 as
> 56 | 78
>which makes it effectively unusable. What good is a stem and leaf
>plot where you can't recover the leading digits of the numbers correctly?
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>
-----------------------------------------------------------------------------------
Peter Wolf, Department of Economics and Business Administration,
University of Bielefeld
pwolf at wiwi.uni-bielefeld.de,
http://www.wiwi.uni-bielefeld.de/~wolf/wolf.html
More information about the R-help
mailing list