search for: x1den

Displaying 1 result from an estimated 1 matches for "x1den".

Did you mean: den
2010 Sep 22
2
Determine area between two density plots
Hi group, I am creating two density plots as shown in the code below: x1 <- c(1,4,5,3,2,3,4,5,6,5,4,3,2,1,1,1,2,3) x2 <- c(1,4,5,3,5,7,4,5,6,1,1,1,2,1,1,1,2,3) plot(density(x1, na.rm = TRUE)) polygon(density(x2, na.rm = TRUE), border="blue") How can I determine the area that is covered between the two plots as a number and how can I grey (or highlight with a pattern) the area