I want to calculate the area under the curve for each column of a big data frame in which the limits for the integration are different in each column and are stored in a different data frame (df2). Particularly, df2 indicates the position of the start and end point for the integration.
n = 1:100
s = 52:151
b = 68:167
df = data.frame(n, s, b)
start = c(45,50,38)
end = c(68,70,72)
df2 = data.frame(start, end)
I used the function auc from MESS library, in order to calculate the auc from one column, but I have stacked to do it for all
Can anyone provide some suggestions that how I can do this? There is another package which fits better in my problem?
Thank you in advance