ggobi / ggally

R package that extends ggplot2

Home Page:http://ggobi.github.io/ggally/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ggcoef_model() Broken for fixest model objects

spocksdad opened this issue · comments

commented

Hello! Love this function but it doesn't work with fixest model objects natively, the old version (ggcoef) does. Could this possibly be fixed?

Here's a reproduce...

library(fixest)
library(ggplot2)
library(GGally)
toymodel <- feols(fml = mpg ~ am,data=mtcars)
GGally::ggcoef_model(toymodel)#breaks

It seems that such models are not properly handled by broom.helpers

library(fixest)
library(broom.helpers)

mod <- feols(fml = mpg ~ am, data = mtcars)
tidy_plus_plus(mod)
#> x Unable to identify the list of variables.
#> 
#> This is usually due to an error calling `stats::model.frame(x)`or `stats::model.matrix(x)`.
#> It could be the case if that type of model does not implement these methods.
#> Rarely, this error may occur if the model object was created within
#> a functional programming framework (e.g. using `lappy()`, `purrr::map()`, etc.).
#> Error in `dplyr::left_join()`:
#> ! Join columns must be present in data.
#> x Problem with `variable`.
model.frame(mod)
#> Error in eval(predvars, data, env): objet 'mpg' introuvable
model.matrix(mod)
#>       (Intercept) am
#>  [1,]           1  1
#>  [2,]           1  1
#>  [3,]           1  1
#>  [4,]           1  0
#>  [5,]           1  0
#>  [6,]           1  0
#>  [7,]           1  0
#>  [8,]           1  0
#>  [9,]           1  0
#> [10,]           1  0
#> [11,]           1  0
#> [12,]           1  0
#> [13,]           1  0
#> [14,]           1  0
#> [15,]           1  0
#> [16,]           1  0
#> [17,]           1  0
#> [18,]           1  1
#> [19,]           1  1
#> [20,]           1  1
#> [21,]           1  0
#> [22,]           1  0
#> [23,]           1  0
#> [24,]           1  0
#> [25,]           1  0
#> [26,]           1  1
#> [27,]           1  1
#> [28,]           1  1
#> [29,]           1  1
#> [30,]           1  1
#> [31,]           1  1
#> [32,]           1  1

Created on 2022-06-30 by the reprex package (v2.0.1)

commented

Thanks for the very swift replies, looking forward to the update

This issue could be closed.

Fixed in broom.helpers