Summarise your p-values with emoji
Arguments
- x
A vector of p-values.
- names
A character vector, for each of the p-value cutoff points. The names are being passed to
emoji()
.- cutpoints
A numeric vector of cutpoints between emojis.
- legend
Logical, denotes if the result should be returned with a legend.
Details
This function is vectorized. The input cutpoints
must be 1 shorter than the
names
input. The input cutpoints
should not include 0 or 1 and be in
accending order.
Examples
set.seed(1234)
emoji_p(1)
#> [1] "💩"
emoji_p(0.1)
#> [1] "🤔"
emoji_p(0.05)
#> [1] "😄"
emoji_p(0.01)
#> [1] "😁"
emoji_p(1e-6)
#> [1] "😆"
emoji_p(0.01, legend = TRUE)
#> [1] 😁
#> attr(,"legend")
#> [1] 0 ‘😆’ 1e-05 ‘😂’ 0.001 ‘😁’ 0.01 ‘😄’ 0.05 ‘🤔’ 0.1 ‘💩’ 1
emoji_p(rbeta(50, 2, 5))
#> [1] "💩" "💩" "💩" "😄" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩"
#> [16] "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "🤔" "💩" "💩" "💩" "💩" "💩"
#> [31] "💩" "💩" "💩" "🤔" "💩" "😄" "🤔" "💩" "💩" "💩" "💩" "💩" "💩" "💩" "💩"
#> [46] "💩" "🤔" "💩" "💩" "😄"
emoji_p(
runif(100, 0, 0.1),
names = c("biceps", "hundred", "thumbs_down", "thumbs_up"),
cutpoints = c(0.001, 0.01, 0.05)
)
#> [1] "👎" "👎" "👎" "👎" "👎" "👎" "👎" "💯" "👍" "👎" "👍" "👎" "👎" "👍" "👍"
#> [16] "👎" "👎" "👍" "👍" "👍" "👍" "👍" "👎" "👎" "👎" "👍" "👎" "👎" "👍" "👍"
#> [31] "👎" "👎" "👍" "👎" "👍" "👍" "👍" "👍" "👍" "👍" "👎" "👎" "👎" "👍" "👍"
#> [46] "👍" "👍" "👍" "👎" "👎" "💯" "👍" "👎" "👍" "👍" "👍" "👎" "👍" "👎" "👍"
#> [61] "👎" "👎" "💯" "👍" "👎" "💯" "👍" "👎" "👍" "👍" "👍" "👎" "👎" "👍" "👎"
#> [76] "👍" "👎" "👎" "👎" "👎" "👍" "💯" "👍" "💯" "👍" "👍" "👎" "👍" "👍" "👍"
#> [91] "👎" "👍" "👍" "👍" "👍" "👍" "👍" "👍" "👍" "👍"