Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggcoef_model() Broken for fixest model objects #443

Open
spocksdad opened this issue Jun 30, 2022 · 5 comments
Open

ggcoef_model() Broken for fixest model objects #443

spocksdad opened this issue Jun 30, 2022 · 5 comments

Comments

@spocksdad
Copy link

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
@larmarange
Copy link
Contributor

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

@larmarange
Copy link
Contributor

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)

@spocksdad
Copy link
Author

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

@larmarange
Copy link
Contributor

This issue could be closed.

@larmarange
Copy link
Contributor

Fixed in broom.helpers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants