write_p {tldr} | R Documentation |
Format a p-value for display
Description
write_p
formats a p-value for display in an RMarkdown document.
Usage
write_p(x, digits = 2)
Arguments
x |
A length-1 numeric or a list-like object with element named |
digits |
Number of digits to round to (default to 2) |
Details
If x < 10^(-digits), then the result is the string p < 10^(-digits) in decimal notation.
Value
Returns a LaTeX-formatted string to report a p-value to the specified number of digits.
Examples
write_p(0.2345)
write_p(0.000234)
x = rnorm(10)
test1 = t.test(x)
write_p(test1)
[Package tldr version 0.4.0 Index]