easystats / easystats/parameters
glht objects are not relabeled
Open
Nobody has claimed this yet.
Bug :bug:
Enhancement :boom:
- Dominant language
- R
- Stars
- 499
- Forks
- 45
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 3
Description
Bug reported upstream following https://github.com/vincentarelbundock/modelsummary/issues/897
library(magrittr)
library(glmmTMB)
mydf <- mtcars
mydf %<>% labelled::set_variable_labels(
mpg = "Miles per gallon",
cyl = "Number of cylinders",
gear = "Number of forward gears"
)
fit <- glmmTMB(mpg ~ cyl * gear,
data = mydf,
family = gaussian(link = "identity"))
res <- multcomp::glht(fit, linfct = "cyl + gear = 0")
p <- parameters::parameters(res, pretty_names = "labels")
attr(p, "pretty_labels")
#> cyl + gear == 0
#> "cyl + gear == 0"
cyl and gear should have been relabelled
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reproduction in issue #1139 with glmmTMB, multcomp::glht, and parameters::parameters. Trace how glht parameter names are processed for pretty_names = "labels"; done means the cyl and gear labels appear in attr(p, "pretty_labels") instead of the original expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100