Skip to content

Additional formatting for p values #213

Closed

Description

@GegznaV

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?

Activity

  1. hadley commented on Oct 25, 2019

    @hadley
    Member

    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()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions