Convert continuous p-values into a factor based on the given split.

discrete_pvalue(p.value, split_by = c(0.001, 0.01, 0.05))

Arguments

p.value

Vector of p-values.

split_by

Where to split the p-values up by. Default is the <0.001, <0.01, <0.05, and all others are >0.05.

Value

A factor vector of p-value splits.

Examples

pvals <- c(0.001, 0.0123, 0.123, 0.009, 0.2145, 0.987, 0.05, 0.049, 0.051) discrete_pvalue(pvals)
#> [1] <0.001 <0.05 >0.05 <0.01 >0.05 >0.05 <0.05 <0.05 >0.05 #> Levels: >0.05 < <0.05 < <0.01 < <0.001
discrete_pvalue(pvals, split_by = c(0.05))
#> [1] <0.05 <0.05 >0.05 <0.05 >0.05 >0.05 <0.05 <0.05 >0.05 #> Levels: >0.05 < <0.05
discrete_pvalue(pvals, split_by = c(0.01))
#> [1] <0.01 >0.01 >0.01 <0.01 >0.01 >0.01 >0.01 >0.01 >0.01 #> Levels: >0.01 < <0.01
discrete_pvalue(pvals, split_by = c(0.01, 0.05))
#> [1] <0.01 <0.05 >0.05 <0.01 >0.05 >0.05 <0.05 <0.05 >0.05 #> Levels: >0.05 < <0.05 < <0.01
discrete_pvalue(pvals, split_by = c(0.05, 0.001, 0.01))
#> [1] <0.001 <0.05 >0.05 <0.01 >0.05 >0.05 <0.05 <0.05 >0.05 #> Levels: >0.05 < <0.05 < <0.01 < <0.001