继发帖后: Fitting several regression models with dplyr
尝试将其应用于data.table时遇到了问题。当数据是data.frame
时,问题不存在示例:
library(data.table)
library(dplyr)
mtcarsDT <- data.table(mtcars)
lmGroups <- mtcarsDT %>%
group_by(cyl) %>%
do(mod = lm(mpg ~ disp, data = .))
提取模型的系数
lmGroups %>%
do(data.frame(var = names(coef(.$mod)),
coef = coef(.$mod)))
do_.tbl_dt(.data,.dots = lazyeval :: lazy_dots(...))出错:参数“.f”缺失,没有默认值
library(broom)
lmGroups %>% tidy(mod)
psych :: describe(x,...)中的错误:找不到对象'mod'
答案 0 :(得分:1)
我将dplyr从0.4.3升级到0.5.0并解决了这个问题。要关闭问题。谢谢