fixest icon indicating copy to clipboard operation
fixest copied to clipboard

fixest v0.12.0: Error in cat_magic when running feols

Open mojihelen opened this issue 1 year ago • 6 comments

Trying feols for the first time using the example iris dataset from the Website. Received attached error message regarding cat_magic. Running R version 4.1.2 on Ubuntu server.

OLS estimation, Dep. Var.: Sepal.Length
Error: in cat_magic(..., .sep = .sep, .end = .end, .width = ...:
'string_magic' requires at least one character scalar to work.
Named arguments are only used as variables on which to apply interpolation.
FIX: please provide at least one non-named argument. 

Please advise how to resolve this, thanks!

R_Error

mojihelen avatar Apr 24 '24 10:04 mojihelen

I can't reproduce this on R 4.3. Can you also show the version of stringmagic and dreamerr and update them if they are outdated?

packageVersion("fixest")
#> [1] '0.12.0'
packageVersion("stringmagic")
#> [1] '1.1.0'
packageVersion("dreamerr")
#> [1] '1.4.0'

fixest::feols(Sepal.Length ~ Sepal.Width, iris)
#> OLS estimation, Dep. Var.: Sepal.Length
#> Observations: 150
#> Standard-errors: IID 
#>              Estimate Std. Error  t value  Pr(>|t|)    
#> (Intercept)  6.526223   0.478896 13.62763 < 2.2e-16 ***
#> Sepal.Width -0.223361   0.155081 -1.44029    0.1519    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> RMSE: 0.819578   Adj. R2: 0.007159

etiennebacher avatar Apr 24 '24 14:04 etiennebacher

Ubuntu Version 20.04.4 LTS Versions of stringmagic and dreamerr seem ok Screenshot 2024-04-25 113546

mojihelen avatar Apr 25 '24 06:04 mojihelen

Rhoooo, nooo. I'm sorry. Dependency hell pointing its nose. I'll try to fix asap.

lrberge avatar Apr 25 '24 08:04 lrberge

Hmm, I cannot replicate with R 4.0.2 on Debian.

Can you run:

library(dreamerr) ; library(fixest)
setDreamerr_show_stack(TRUE)
est = feols(Sepal.Length ~ Sepal.Width, iris)
print(est)

lrberge avatar Apr 25 '24 09:04 lrberge

We have resolved the issue by upgrading to the latest R version: Screenshot 2024-04-25 192012

Before that I had tried reinstalling the fixest package and I noticed there was a message regarding a previous package I had installed: test

But deinstalling the package coin did not solve the issue..so not sure if it is related, but realized some packages previously installed must be causing the issue, thus decided to reinstall R.

Thank you so much for the quick help and support!

mojihelen avatar Apr 25 '24 11:04 mojihelen

The R namespace management is strict and the results should not depend on the loading of other packages (actually it can, but not for the reported problem). I'm happy upgrading the R version solved the problem, although this is an inconvenience and far from optimal.

Since it's very likely that other users experience this problem following the new version of fixest, I'm leaving the issue open for information purposes.

Thanks for reporting.

lrberge avatar Apr 25 '24 11:04 lrberge

Solved, see #494 Thanks again for swiftly reporting!

lrberge avatar Apr 30 '24 11:04 lrberge