writing a loop and the integrate function
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)
• 723 views
•
link
0 answers
No answers yet.
Log in to answer this question.
This question is not directly related to bioinformatics and is more suitable for posting to a R/Statistics forum. If this is part of a larger bioinformatics question/project then please add that information to the post and we can reopen the question.
Hello alina.vodonos!
We believe that this post does not fit the main topic of this site.
Not related to bioinformatics.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!