Simplify your statistical reporting with compact letter displays
The cld package provides an easy and consistent way to create compact letter displays (CLDs) for visualizing results of pairwise statistical comparisons. Groups sharing the same letter are not significantly different from each other β a convention widely used in agricultural, biological, and statistical publications.
Key Features:
make_cld() handles
all input types automaticallyInstall the stable version from CRAN:
install.packages("cld")Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("GegznaV/cld")The cld package works with various statistical test outputs. Hereβs a simple example:
library(cld)
# Run a pairwise test
test_result <- pairwise.wilcox.test(chickwts$weight, chickwts$feed, exact = FALSE)
# Generate compact letter display
make_cld(test_result)
#> group cld spaced_cld
#> casein a a__
#> horsebean b _b_
#> linseed bc _bc
#> meatmeal ac a_c
#> soybean c __c
#> sunflower a a__Interpretation:
The make_cld() function works seamlessly with:
| Input Type | Example Packages | Function Examples |
|---|---|---|
pairwise.htest |
base R | pairwise.t.test(),
pairwise.wilcox.test() |
PMCMR / PMCMRplus |
PMCMR, PMCMRplus | kwAllPairsConoverTest(), dunnTest() |
data.frame (rstatix) |
rstatix | games_howell_test(), tukey_hsd() |
PostHocTest |
DescTools | ConoverTest(), DunnettTest() |
matrix |
Custom | Symmetric p-value matrices |
data.frame |
Custom | Custom comparison data frames |
formula |
Custom | Formula interface for data frames |
π Comprehensive vignettes (also available on package website):
vignette("cld") - Complete introduction with
examplesvignette("cld-input-formats") - Detailed examples for
all input typesvignette("cld-interpretation-guide") - How to correctly
interpret CLDsvignette("cld-advanced-features") - Advanced features
and custom parameters| Package | Purpose | Relationship to cld |
|---|---|---|
| multcompView | CLD algorithm | Used internally by cld |
| rcompanion | Statistical functions | Alternative CLD implementation |
| PMCMRplus | Post-hoc tests | Compatible input for cld |
| rstatix | Tidy statistics | Compatible input for cld |
| DescTools | Statistical tools | Compatible input for cld |
?cld::make_cldTo cite the cld package in publications:
citation("cld")GPL-3