[R] producing histogram-like plot

Karin Lagesen karin.lagesen at bio.uio.no
Tue Mar 29 11:05:08 CEST 2011


Hi!

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
-- 
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
http://folk.uio.no/karinlag



More information about the R-help mailing list