Re: [R] Histogram

From: Ritwik Sinha <ritwik.sinha_at_gmail.com>
Date: Wed 27 Sep 2006 - 23:47:46 GMT

Hi,

There may be an easier way but here is one way you can do it.

# create vector that has Y[i] X[i]s
new.data <- rep(X,Y)

hist(new.data, breaks=c(0,.1,.4,.6)) # or something like that look at what exactly breaks should be.

Ritwik.

On 9/27/06, Mohsen Jafarikia <jafarikia@gmail.com> wrote:
> Dear all,
>
> I want to design a histogram and I need to have the frequency at certain
> points. For example I have the following 2 columns:
>
> *X Y*
>
> 0.1 25
> 0.4 22
> 0.45 11
> 0.55 21
>
> I want the chart to have 4 columns. First column is from 0.0-0.1 (on X) and
> frequency is 25. Next colum is wider and form 0.1-0.4 with 22 frequency.
> Next column is narrow with 11 frequency and the last column is the same as
> the first one with 21 frequency.
>
> Can anybody tell me how I can have this chart.
>
> Thanks,
> Mohsen
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
Ritwik Sinha
Graduate Student
Epidemiology and Biostatistics
Case Western Reserve University
ritwik.sinha_at_gmail.com | +12163682366 | http://darwin.cwru.edu/~rsinha

______________________________________________
R-help@stat.math.ethz.ch 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 Thu Sep 28 09:50:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Sep 2006 - 01:30:06 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.