I have the data frame DF. I am using R and dplyr to analise it.
DF contains:
> glimpse(DF) O
I found an easy solution based on this question dplyr::do() requires named function?
Fit <- DF %>% group_by(Channel) %>% do({ fit = lm(mean ~ Col + poly(Row, 2), data = .) pred <- predict(fit) data.frame(., pred) })