I have two columns X1 ,X2 .I want to find area under X1 and area under X2.
X = c(1,2,3,4,5)
Y1 = c(2,3,4,2,3)
Y2 = c(6,6,6,6,6)
plot(X,Y1) #Need to get area under this curve i.e auc(Y1)
plot(X,Y2) #Need to get area under this curve i.e auc(Y2)
I need this so as to I need to compare both areas i.e Y1 and Y2 by taking the ratio AUC(Y1)/AUC(Y2)
I need commulative area at each point.