what is so special about purrr?

The problem is how you are using lm; you shouldn't quote the formulas:


library(purrr)
lm1 <- lm(Sepal.Width ~ Petal.Width, data = iris)
lm2 <- lm(Sepal.Length ~ Petal.Length, data = iris)

list(lm1, lm2) %>% stargazer::stargazer(type = 'text')
#> 
#> ===========================================================
#>                                    Dependent variable:     
#>                                ----------------------------
#>                                 Sepal.Width   Sepal.Length 
#>                                     (1)            (2)     
#> -----------------------------------------------------------
#> Petal.Width                      -0.209***                 
#>                                   (0.044)                  
#>                                                            
#> Petal.Length                                    0.409***   
#>                                                  (0.019)   
#>                                                            
#> Constant                          3.308***      4.307***   
#>                                   (0.062)        (0.078)   
#>                                                            
#> -----------------------------------------------------------
#> Observations                        150            150     
#> R2                                 0.134          0.760    
#> Adjusted R2                        0.128          0.758    
#> Residual Std. Error (df = 148)     0.407          0.407    
#> F Statistic (df = 1; 148)        22.910***     468.550***  
#> ===========================================================
#> Note:                           *p<0.1; **p<0.05; ***p<0.01

Created on 2019-02-24 by the reprex package (v0.2.1)

3 Likes