[R] Histogram + % of cases for a given criteria

S. Nunes snunes at gmail.com
Wed May 13 16:54:47 CEST 2009

Hi all,

I am doing some explorations using a dataset with the following
structure (id, value, flag).
For instance:

a, 2.2, 1
b, 3.0, 1
c, 2.9, 0
d, 3.1, 1

I have plotted a standard histogram using a simple command like:

My question:

I would like to superimpose a line ([0%-100%] scale) representing the
% of values that, for each class of the histogram, have the $flag
equal to 1.

What strategy

I hope I made myself clear. Please let me know if not.

Thanks in advance,
Sérgio Nunes

More information about the R-help mailing list