-
Notifications
You must be signed in to change notification settings - Fork 130
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
it labels the column 'percent'; it's not a percent #470
Comments
"percent" means per 100. A percent is the fraction of a value divided by 100. IE 45% is 45 per 100, or 45/100, which is .45.
|
I agree it is 'per hundred' ... but you need to represent the 'number per
hundred' i.e., '57 per hundred' ... not actually do that division.
I think my way is the standard conventional way. But if you disagree, it's
not a big deal, I can make an adaptation of your function. (and thanks for
the great tools)
For one-way tables I have
```
tabyl_ow <- function(df, var) {
df %>%
tabyl({{var}}) %>%
mutate(percent = 100*percent) %>%
}
```
For multi-way tables with column and row percentage adornments I'm sure
there's a way to make this adjustment
…On Fri, Jan 21, 2022 at 5:14 PM Jonathan Zadra ***@***.***> wrote:
"percent" means per 100. A percent is the fraction of a value divided by
100. IE 45% is 45 per 100, or 45/100, which is .45.
mtcars %>%
tabyl(cyl) %>%
adorn_pct_formatting()
cyl n percent
4 11 34.4%
6 7 21.9%
8 14 43.8%
—
Reply to this email directly, view it on GitHub
<#470 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6ZCMDRNZXIAZVFQXQ25ZDUXHLFPANCNFSM5MQVBHZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
My understanding is that "57 per hundred" is the same as 57%. The % means "per hundred". If you don't have the "%" symbol after the number, the correct way to represent it is as the fraction. 57% is just another way of writing 57/100. If you take the % away from 57%, it's the same as taking the 100 away from 57/100. And 57/100 = .57 (you've removed the "/100" by doing the math). |
But it has the word 'percent' the top of the column. So it implies the
numbers in the column are 'numbers per hundred'.
…On Fri, Jan 21, 2022 at 5:41 PM Jonathan Zadra ***@***.***> wrote:
My understanding is that "57 per hundred" is the same as 57%. The % means
"per hundred".
If you don't have the "%" symbol after the number, the correct way to
represent it is as the fraction.
57% is just another way of writing 57/100.
If you take the % away from 57%, it's the same as taking the 100 away from
57/100. And 57/100 = .57 (you've removed the "/100" by doing the math).
—
Reply to this email directly, view it on GitHub
<#470 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6ZCME3BBE5ZT4FDWOXVV3UXHOLHANCNFSM5MQVBHZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hmm. Yeah I see what you are saying. But regardless it would be a major breaking change to rename that column so I think you're on the right track with just modifying a function as you did. |
OK, it works for me.
If you feel so inclined, I would suggest that the fix multiplies the thing
by 100 if possible, or maybe gives the user an option to choose how they
want to display percentages.
…On Fri, Jan 21, 2022 at 7:23 PM Jonathan Zadra ***@***.***> wrote:
Hmm. Yeah I see what you are saying. But regardless it would be a major
breaking change to rename that column so I think you're on the right track
with just modifying a function as you did.
—
Reply to this email directly, view it on GitHub
<#470 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6ZCMHNGYQPW7SO6JNX46DUXH2JTANCNFSM5MQVBHZQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm glad you like the package! You're correct and not the first person to suggest this. This has been discussed and unfortunately at this point I think the cost of fixing this outweighs the benefits. See #300 for more discussion. |
Feature requests
The column 'percent' should be called 'share' instead (or it should auto-multiply by 100)
Bug reports
Brief description of the problem
outputs
But 'percents' add up to 100, while these add up to 1.
IMO it should output
or
The text was updated successfully, but these errors were encountered: