Entering edit mode
5.9 years ago
alina.vodonos
•
0
I would like to calculate integral from two columns in my data frame the integral is based on a function; 1/x, I quess I need to write a loop . Can you help with writing a loop and the integrate function?
This is the sample data frame;
upper_concentration<-c(1:200, 1)
lower_concentration<-upper_concentration*0.9
df = data.frame(upper_concentration,lower_concentration)
for (i in 1:(length(df))){
integral <- function (x) {1/df$upper_concentration}
result <- integrate(integral, lower = df$upper_concentration, upper =upper_concentration*0.9)