[R] producing histogram-like plot

From: Karin Lagesen <karin.lagesen_at_bio.uio.no>
Date: Tue, 29 Mar 2011 11:05:08 +0200


I have a dataset that looks like this:

0.0	14
0.0	3
0.9	12
0.73	15
0.78	2
1.0	15
0.3	2
0.32	8

...and so on.

I.e. a value between 0 and 1, and a number

I would like to plot this in a histogram-like manner. I would like to have a set of bins, each 0.1 wide, and plot the sum of values in column 2 that falls within each bin. I.e, in this case I would like the first bin, 0.0, to have the value 17, the second, 0.1, to have the value 0 and so on, until the last bin which has the value 15. I am sadly uncertain of both how to sum these together, and also on which plot type to use.

Thanks in advance!


Karin Lagesen, Ph.D.
Centre for Ecological and Evolutionary Synthesis (CEES)
University of Oslo, Dept. of Biology
P.O. Box 1066 Blindern 0316 Oslo, Norway
Ph. +47 22844132 Fax. +47 22854001
Email karin.lagesen_at_bio.uio.no

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 Mar 2011 - 09:38:20 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 Tue 29 Mar 2011 - 22:50:24 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