Showing fitted values with R and dplyr

后端 未结 2 1890
既然无缘
既然无缘 2021-01-14 07:13

I have the data frame DF. I am using R and dplyr to analise it.

DF contains:

>   glimpse(DF)
O         


        
2条回答
  •  清歌不尽
    2021-01-14 07:49

    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)
        })
    

提交回复
热议问题