Hi!
I have a dataset that looks like this:
0.0 14
0.0 3
0.9 12
0.7315
0.782
1.0 15
0.3 2
0.328
...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,
On Tue, Mar 29, 2011 at 11:05:08AM +0200, Karin Lagesen wrote:
Hi!
I have a dataset that looks like this:
0.0 14
0.0 3
0.9 12
...and so on.
I would like to plot this in a histogram-like manner.
One way would be to re-create the original data and then simply use
hist:
dat -
-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Karin Lagesen
Sent: Tuesday, March 29, 2011 3:05 AM
To: r-help@r-project.org
Subject: [R] producing histogram-like plot
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
Hi:
Here's one way to do it, using ggplot2 and base graphics.
# Simulate a data frame with values between 0 and 1 and a corresponding
frequency
df - data.frame(val = round(runif(100), 2), freq = rpois(100, 10))
# findInterval assigns the values between 0 and 1 to intervals with width
0.1; you
4 matches
Mail list logo