# Basic usage
format_pvalue(0.05)
format_pvalue(0.0001)
# More rounding
format_pvalue(0.0001,digits=2)
# Vector input
format_pvalue(c(0.05, 0.001, 0.00001, 0.99))
# With p prefix
format_pvalue(0.05, include_p = TRUE)
Run the code above in your browser using DataLab