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

Additional formatting for p values #213

Closed
GegznaV opened this issue Jun 21, 2019 · 1 comment
Closed

Additional formatting for p values #213

GegznaV opened this issue Jun 21, 2019 · 1 comment

Comments

@GegznaV
Copy link

GegznaV commented Jun 21, 2019

Can extra options be added to functions pvalue() and pvalue_format() to format p values more flexibly:

  1. For big p values, can > be added, e.g., p > 0.999 instead of p = 1.000?
    Desired ouptut:
pvalue(0.999945)
## p>0.999
  1. An option to add extra spaces around >, = or < would be useful too.
    E.g.:
pvalue(0.523)
## p=0.523
pvalue(0.523, spaces = TRUE)
## p = 0.523

An example where this feature could be used: kassambara/ggpubr#186

  1. Possibility to remove leading zero (as this is a common practice in APA style statistical reports):
    E.g.:
pvalue(0.523, leading_zero = FALSE)
## p=.523
  1. Add option to force = in the output even if add_p = FALSE

Can any of these ideas be implemented in scales package?

@hadley
Copy link
Member

hadley commented Oct 25, 2019

I did all of these (mostly via the new prefix argument) except leading_zero because implementing that look like it was going to be fiddly (since there's no equivalent in format()).

@hadley hadley closed this as completed in 9d14347 Oct 25, 2019
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