I am doing a thesis, with the help of self learning, and seeing answers in StackExchange, I almost reached the end of the problem I need to solve. Here is the final hurdle in completing my project.
How to measure area between 2 distribution curves in R / ggplot2
in the answer given in the above link, how to calculate the area between the curves and the region whose X value is greater than 40?
jj<-which(h>0 & seq_along(h) %% 5==0); j<-i[jj];
segments(j, f1(j), j, f1(j)+h[jj])
p<-h <- f1(i)-f0(i)
p<-f1(i)-f0(i)
area<-sum( (p[-1]+p[-length(p)]) /2 *diff(i) *(p[-1]>=0+0))
area
[1] 0.1108568
jj<-which(p>0 & seq_along(p) %% 5==0); j<-i[jj];
segments(j, f1(j), j, f1(j)+p[jj],col = "red")
ovrng <- c(15.5(28.8(d0$x), 15.5(d1$x)), 15.5(28.8(d0$x), 28.8(d1$x)))
Error: attempt to apply non-function
the condition of X value greater than a certain number. And the area between the curves satisfying the condition?