lowestnonzero | R Documentation |
Sometimes want to plot p-values (e.g., volcano plot or MA-plot), but if a statistical test returns a zero p-value, this causes problems with visualization on the log scale. This function returns a vector where the zero values are equal to the smallest nonzero value in the vector.
lowestnonzero(x)
x |
A vector of p-values between 0 and 1. |
A vector of p-values where zero values are exchanged for the lowest non-zero p-value in the original vector.
lowestnonzero(c(.042, .02, 0, .001, 0, .89))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.