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

incorrect y axis label #146

Closed
nicholasjhorton opened this issue Mar 3, 2021 · 2 comments
Closed

incorrect y axis label #146

nicholasjhorton opened this issue Mar 3, 2021 · 2 comments
Assignees

Comments

@nicholasjhorton
Copy link

Any idea why the y axis label is inheriting the Y value label from the linear model?

suppressPackageStartupMessages(library(mosaic))
mod1 <- lm(pcs ~ mcs, data = HELPrct) %>%
  broom::augment()
gf_point(.resid ~ mcs, data = mod1) %>%
  gf_smooth() %>%
  gf_lm()
#> `geom_smooth()` using method = 'loess'

Created on 2021-03-03 by the reprex package (v1.0.0)

@rpruim
Copy link

rpruim commented Jun 21, 2021

Just noticing this. Sorry for the delay.

The issue is with {broom}, which labels the residuals that way:

suppressPackageStartupMessages(library("mosaicData"))
suppressPackageStartupMessages(library("ggformula"))
mod1 <- lm(pcs ~ mcs, data = HELPrct) %>%
  broom::augment()

attributes(mod1$.resid)
#> $label
#> [1] "SF-36 Physical Component Score"

Created on 2021-06-21 by the reprex package (v0.3.0)

We could avoid this if we changed the way we look for labels. Currently, we use the label attribute if it exists. We could be pickier and require that the variable have one of several specified classes (like "labelled" or "declared").

Reconsidering labels is on the to-do list -- see #148

@rpruim rpruim self-assigned this Jun 21, 2021
@rpruim
Copy link

rpruim commented Jun 21, 2021

I'm going to close this in favor of #148. I've also posted an issue to {broom} to see if the current behavior is desired. See tidymodels/broom#1031

@rpruim rpruim closed this as completed Jun 21, 2021
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