Filter parameters, run a function on the filtered parameters, and looping

hi im trying to filter out data into 2 parameters only and to run some function on it. but, it needs to be in a loop, as they'll be around 6 sets of data (2 parameters each [C and A, D and A, E and A, C and B, D and B, E and B]). so, what type of loop should I use?

data1<- filter(dat, ((treatment2== "C") & (treatment2== "A")))
print (data)

(this is where the loop needs)

function <- function(data1, intercept, slope, pow){
predicty = (intercept + slope (C ^ pow)
SSE= sum((data1 - predicty)^2)
return
}

R has for, but it's not often the preferred approach. For an example see this recent post. Come back with a reprex (see the FAQ) if help is needed.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.