I would like to shade the area between two curves generated by the ecdf 
function. 
There are examples such as those explained here 
http://www.alisonsinclair.ca/2011/03/shading-between-curves-in-r/
These examples do not apply to the objects generated by the ecdf function. 
#############
library(truncnorm)
x  <- rtruncnorm(100, 3,  25,  15,  5)
y  <- rtruncnorm(100, 5,  30,  17,  8)
x <- ecdf(x)
y <- ecdf(y)
plot(x)
lines(y)
#This is not working
polygon(x, y, xpd = xpd, col = "orange", lty = 2, lwd = 2, border = "red")
#How to shade the area between the curve 
#calculate the area between the two curves


Peter Maclean
Department of Economics
UDSM

______________________________________________
R-help@r-project.org 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.

Reply via email to