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

Data with "Yes" and "No" factor levels cannot correctly display #533

Closed
zeyunlu opened this issue Jun 11, 2020 · 1 comment
Closed

Data with "Yes" and "No" factor levels cannot correctly display #533

zeyunlu opened this issue Jun 11, 2020 · 1 comment

Comments

@zeyunlu
Copy link

zeyunlu commented Jun 11, 2020

If we run following codes, "Yes" and "No" cannot be correctly displayed.

I'm not sure if it is a bug or it is intentionally programmed like this.

It would be great if we are able to use "Yes" and "No" as data factor levels

tmp <- data.frame(v1 = factor(sample(c("Yes", "No"), 100, replace = TRUE)),
  v2 = factor(sample(c("Yes", "No"), 100, replace = TRUE)))

tbl_summary(tmp)

tmp2 <- data.frame(v1 = factor(sample(c("1", "2"), 100, replace = TRUE)),
  v2 = factor(sample(c("Y", "N"), 100, replace = TRUE)))

tbl_summary(tmp2)
@ddsjoberg
Copy link
Owner

Review the tbl_summary(type=) documentation for details on default printing. The default is to print yes/no as dichotomous variables, and all defaults can be updated.
http://www.danieldsjoberg.com/gtsummary/reference/tbl_summary.html#type-argument

Happy Coding!

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