[R] How to color certain area under curve
guox at ucalgary.ca
guox at ucalgary.ca
Tue Mar 10 18:30:45 CET 2009
For a given random variable rv, for instance, rv = rnorm(1000),
I plot its density curve and calculate some quantiles:
plot(density(rv))
P10P50P90 = = quantile(rv,probs = c(10,50,90)/100)
I would like to color the area between P10 and P90 and under the curve
and mark the P50 on the curve.
> rv = rnorm(1000)
> plot(density(rv))
> P10P50P90 = = quantile(rv,probs = c(10,50,90)/100)
Could you please teach me how to do these using R?
Thanks,
-james
More information about the R-help
mailing list