Skip to content

etable() drops whitespaces from factor labels #608

@etiennebacher

Description

@etiennebacher

When the factor labels contain spaces, those are removed by etable(). Is it possible to preserve them?

library(fixest)
packageVersion("fixest")
#> [1] '0.13.2'

test <- data.frame(
  y = 1:5,
  fac = factor(c("first cat", "second cat", "first cat", "second cat", "first cat"))
)

res <- feols(y ~ fac, data = test)
etable(res)
#>                              res
#> Dependent Var.:                y
#>                                 
#> Constant          3.000. (1.054)
#> facsecondcat    8.88e-16 (1.667) # <<<<<<<<<<<<<<<< "facsecondcat" instead of "fac second cat"
#> _______________ ________________
#> S.E. type                    IID
#> Observations                   5
#> R2                         0e-16
#> Adj. R2                 -0.33333
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

res <- feols(y ~ i(fac, ref = "first cat"), data = test)
etable(res)
#>                              res
#> Dependent Var.:                y
#>                                 
#> Constant          3.000. (1.054)
#> fac = secondcat 8.88e-16 (1.667) # <<<<<<<<<<<<<<<< "secondcat" instead of "second cat"
#> _______________ ________________
#> S.E. type                    IID
#> Observations                   5
#> R2                         0e-16
#> Adj. R2                 -0.33333
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Thanks again for this awesome package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions