p2asterisk | R Documentation |
The function map p values into asterisks by common definitions
p2asterisk(p, use0.1 = TRUE)
p |
Numerical, p values (between 0 and 1), can be a matrix or more generally an array |
use0.1 |
Logical, whether a dot should be displayed if 0.05<p<0.1 |
A character vector of the same length as p
of asterisk
symbols. In case p
is an array, both 'dim' and 'dimnames' properties
are copied to the returning value.
NA
will be mapped to empty strings.
myPvals <- c(0.0005, 0.02, 0.4, 0.075, NA, 0.0044)
myPasterisks <- p2asterisk(myPvals, use0.1=FALSE)
stopifnot(identical(myPasterisks, c("***", "*", "", "", "", "**")))
myPasterisks2 <- p2asterisk(myPvals, use0.1=TRUE)
stopifnot(identical(myPasterisks2, c("***", "*", "", ".", "", "**")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.