问题 I have a data frame and I need to run 6 2-variable linear models for each group 'site'. Then, I need to convert the results to a data frame. The second variable in the linear model changes. I have that part down using lapply() , but I can't figure out how to run by groups. I've found answers on SO that answer parts of my question, but I can't figure out how to put it all together. Here's some data: structure(list(SiteName = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c(