Display missingness by trait, observation and phylogenetic tip order, or display the fraction of observations missing both traits. Patterns can suggest structure to investigate; they cannot establish whether data are missing completely at random. Trait groups expanded into multiple latent columns count as missing when all their columns are missing.
Usage
plot_missingness(
x,
type = c("summary", "matrix", "phylo", "co_missing"),
tree = NULL
)Examples
data(avonet300, tree300)
tree <- ape::keep.tip(tree300, tree300$tip.label[seq_len(30)])
d <- avonet300[match(tree$tip.label, avonet300$Species_Key),
c("Mass", "Wing.Length"), drop = FALSE]
rownames(d) <- tree$tip.label
d$Mass[1:3] <- NA
x <- preprocess_traits(d, tree)
plot_missingness(x, "summary")
plot_missingness(x, "phylo", tree)
