如何broom::glance或总结几个系统发育gls并保存为tibble?

How to broom::glance or summarize several phylogenetic gls and save as tibble?

我有几个系统发育 GLS,想找到一个更好的方法来总结结果。我没有使用循环来获得多个 PGLS,因为我将从不同的矩阵中收集多个特征。示例如下:

library(caper) # for the pgls method
library(dplyr)
library(broom)
library(purrr)

data(shorebird)
birdie <- comparative.data(shorebird.tree, shorebird.data, Species)

pgls.EggVsMass <- pgls( Egg.Mass ~ M.Mass, birdie)
pgls.EggVsClutch <- pgls( Egg.Mass ~ Cl.size, birdie)

SUM.EggVsMass <- summary(pgls.EggVsMass)$coefficients
SUM.EggVsClutch <- summary(pgls.EggVsClutch)$coefficients

GL <- mget(ls(pattern = "SUM.*"))

tidier <- GL  %>%  purrr::map(., glance)

但是 object 'tidier' 不是简单的小标题,我无法正确保存它。我怎样才能改进这个策略并获得摘要中的信息或系数的小标题?

类似的代码,但 lm 有效,所以我想以类似的方式解决 PGLS。在上述情况下使用 map_df 不起作用。

LMTRAIT <- names(data)[-1] %>% 
  paste('trait1 ~', .) %>%    
  map(lm, data) %>% 
  purrr::map_df(., broom::glance) # 
as_tibble(LMTRAIT)

我通过 map_chr::repurrrsive

找到了解决方案

如果我想拦截我必须获得的每一个特征

GL$SUM.EggVsClutch[1]
GL$SUM.EggVsMass[1]

这是 map_chr

library(repurrrsive)
as_tibble(map_chr(GL, 1))