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

Labelled column headers are right aligned in tibble output #676

Closed
MokeEire opened this issue Apr 14, 2022 · 1 comment
Closed

Labelled column headers are right aligned in tibble output #676

MokeEire opened this issue Apr 14, 2022 · 1 comment

Comments

@MokeEire
Copy link

Column headers for labelled columns are right aligned in console tibble output which can make it difficult to interpret which values are associated with which column. See below:

image

col3 is almost above the values of col4, making it difficult to read.

Hopefully useful reprex

library(purrr)
library(tibble)
library(haven)

# Combine labelled columns into tibble
map_dfc(paste0("col", 1:4), 
        # Create labelled column
        ~tibble(!!.x := labelled(sample(c(1,5,8,9), 20, replace = T),
                                 labels = c(Yes = 1, No = 5,
                                            `Don't know` = 8,
                                            Refused = 9))))
@gorcha
Copy link
Member

gorcha commented Apr 25, 2022

Hey @MokeEire,

Thanks for the change request! haven defaults to right alignment since these are ultimately double variables, but agree that left alignment makes more sense in most cases once labels are included.

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