Re: [R] using the stepfun to plot histogram outline.

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sat, 21 Jun 2008 10:21:01 -0500

On Sat, Jun 21, 2008 at 3:36 AM, Karin Lagesen <karinlag_at_studmed.uio.no> wrote:
>
> Hello list:)
>
> I have lots of values which I would like to get a histogram outline
> out of.
>
> An example of what I am talking about:
>
> testdata = runif(100)
> bbb = seq(0,1, by = 0.01)
> hist(testdata, breaks = bbb)
>
> I would like to get the outline of the resulting histogram.

Do you want to draw the outline, or create a function that represents it? (that's what stepfun will do) Either way looking at:

h <- hist(testdata, breaks = bbb)
str(h)

will probably be helpful.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 21 Jun 2008 - 16:00:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 21 Jun 2008 - 16:30:48 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive