Description Usage Arguments Examples
View source: R/prettifyPValues.R
This is a small vectorised wrapper to convert pvalues to a significant number of decimal places and replace those less than that with a less than symbol, e.g. to two decimal places 0.007 will return <0.01, but to three it will return 0.007. it also utilises round with zero to keep trailing zeros. This is important for p-values because it shows the accuracy you have reported.
1 | prettifyPValue(pvalue, digits = 3, signif = NULL)
|
pvalue |
A value or vector of numerical pvalues |
digits |
The number of digits to report to the right of the decimal place |
signif |
optional parameter. Adds a star to those values less than the value of signif to highlight significant results. |
1 2 3 4 5 | pvalues = c(0.1257,0.0675,0.0345,0.0016,0.0009)
# Two decimal places
prettifyPValue(pvalues, digits=2)
# Three decimal places with a star for those less than 0.05
prettifyPValue(pvalues, digits=3, signif=0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.