[R] Part of a density plot

Peter Ehlers ehlers at ucalgary.ca
Sun Mar 20 03:53:18 CET 2011


On 2011-03-19 19:15, Jim Silverton wrote:
> Suupose I have
> y<- rbeta(10000, 2, 5)
> and I only want to see only the density plot from x = 0 to x = 1
> How do I do this?

I'm not quite sure what you want, but this may be it:

  plot(density(y), xlim = c(0, 1), xaxs = 'i')

Peter Ehlers



More information about the R-help mailing list