pvalr | R Documentation |
Formats several cases of p-values; see details.
Note that a previous pvalr
function had additional arguments. For
this version, see rawr2::pvalr
.
pvalr(
pv,
sig.limit = 1e-03,
digits = 2L,
scientific = FALSE,
html = FALSE,
show.p = FALSE,
...
)
pvalr2(pv, html = FALSE, show.p = FALSE)
color_pval(
pv,
breaks = c(0, 0.01, 0.05, 0.1, 0.5, 1),
cols = colorRampPalette(2:1)(length(breaks)),
sig.limit = 1e-03,
digits = 2L,
show.p = FALSE,
format_pval = TRUE,
na = "-",
...
)
pv |
for |
sig.limit |
lower bound for precision; smaller values will be shown as
|
digits |
number of significant digits |
scientific |
see |
html |
logical; if |
show.p |
logical; if |
... |
ignored |
breaks , cols |
a numeric vector defining breaks in |
format_pval |
logical; if |
na |
a string used for |
pvalr
rounds numeric values to a specified number of significant
digits
and add (if necessary) trailing 0s. The result will be a
character string to prevent loss of significant digits.
Note that negative values are treated as small p-values (similar to
format.pval
), but unlike format.pval
, values greater than 1
are formatted as > 1 - 1 / 10 ^ digits
pvalr2
deals with common cases of character string p-values which are
not ideal (0.000, 1.00, etc.) and will leave others unchanged.
roundr
; format.pval
;
rawr:::signif2
pv <- c(-1, 0.001, 0.0001, 0.0042, 0.0601, 0.1335, 0.4999, 0.9, 0.997, 1, 2)
format.pval(pv, eps = 0.001)
pvalr(pv)
pvalr(pv, digits = 3)
pvalr(pv, show.p = TRUE, html = TRUE)
## Not run:
## older version of pvalr in rawr2 package
## note differences in digits used
rawr2::pvalr(pv)
rawr2::pvalr(pv, journal = FALSE)
rawr2::pvalr(pv, limits = 0.1)
## End(Not run)
pv <- c('0.00000', '< 0.001', '0.0', '0.123', '0.6', '1', '1.0', '1.000')
pvalr2(pv)
## Not run:
pv <- c(0, 0.00001, 0.03, 0.06, 0.11, 0.49, 0.51, 0.89, 0.9, 1)
show_html(color_pval(pv))
show_html(color_pval(pv, format_pval = format.pval))
show_html(iprint(color_pval(pv, show.p = TRUE)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.