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

The column "percent" in a one-way tabyl() should be renamed to "proportion" #342

Closed
wordsmith189 opened this issue Mar 7, 2020 · 3 comments
Labels
seeking comments Users and any interested parties should please weigh in - this is in a discussion phase!
Milestone

Comments

@wordsmith189
Copy link

Bug reports

Good afternoon,

I love tabyl()!!!! I use it every day. But when I use it in teaching, I always have to point out that the reported "percent" isn't actually percent - it's the proportion. Would it be possible to either multiply the number by 100 and thus report actual percent, or rename the column?

Many thanks!

@sfirke
Copy link
Owner

sfirke commented Mar 7, 2020

You are right 😜 This was raised in #300 and elsewhere.

You can do the former, multiply by 100, like this:

mtcars %>% tabyl(am) %>% adorn_pct_formatting()

To be strictly correct, it would have to start off "proportion", then the adorn_pct_formatting() operation would retitle the column to "percent". But having an operation like that retitle a column seems too heavy-handed. I guess if it started as "proportion" and stayed "proportion" once it was percent, would that be less wrong in total?

All that to say, I think you're right, but I'm inclined to leave it as is for the same reasons as stated in #300. BUT, if I was ever going to change this, it would be this week since janitor 2.0.0 is coming out soon and it will have breaking changes so is the place to break more things. I'll leave open for comment for a week to see what others think.

@sfirke sfirke added this to the v2.0 milestone Mar 7, 2020
@sfirke sfirke added the seeking comments Users and any interested parties should please weigh in - this is in a discussion phase! label Mar 7, 2020
@sfirke sfirke changed the title tabyl() "percent" should be called "proportion" The column "percent" in a one-way tabyl() should be renamed to "proportion" Mar 7, 2020
@jzadra
Copy link
Contributor

jzadra commented Mar 15, 2020

My two cents: it seems like this is a minor convention that would introduce way too much complexity than it's worth. I and the people I work with are so used to thinking of percents as 0-1 values that this never even crossed my mind. I prefer to use proportions because in R those are still numeric. I apply percent formatting at the very, very last step for presentation.

Most notably, if the column name were to change from proportion to percent after adorning percent formatting, it has high potential to break code if the user was doing things with the tables downstream, and decided at some point they wanted to use percent formatting earlier.

@sfirke
Copy link
Owner

sfirke commented Apr 4, 2020

Yep I think in this case, the consistency outweighs any advantage to renaming, so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
seeking comments Users and any interested parties should please weigh in - this is in a discussion phase!
Projects
None yet
Development

No branches or pull requests

3 participants