View source: R/remove_splits.R
| remove_splits | R Documentation |
Function returns hespdiv object, without split-lines of specified id.
remove_splits(obj, split.id, depend.splits = TRUE)
obj |
hespdiv object |
split.id |
vector of split-line ids |
depend.splits |
logical. Remove split-lines that depend on specified split-lines? If FALSE, only end-nodes of spatial dendrogram are removed. |
hespdiv object
if (requireNamespace("HDData")) {
# Inspect the hespdiv object
print(plot_hespdiv(HDData::hd))
# Remove weak split-lines
weak_splits <- which(HDData::hd$split.stats$performance >= 0.3)
performance_filtered <- remove_splits(obj = HDData::hd, split.id = weak_splits)
print(plot_hespdiv(performance_filtered))
# Remove non-significant split-lines
plot(HDData::nl)
nsig_splits <- which(HDData::nl[[1]]$quantile >= 0.05)
sig_filtered <- remove_splits(obj = HDData::hd, split.id = nsig_splits)
print(plot_hespdiv(sig_filtered))
# Remove only if a split-line has no dependent split-lines
unchanged_hd <- remove_splits(obj = HDData::hd, split.id = 4, depend.splits = FALSE)
print(plot_hespdiv(unchanged_hd))
# Remove the split-lines indicated as well as all other split-lines
# that structurally depend on them (default behavior)
changed_hd <- remove_splits(obj = HDData::hd, split.id = 4, depend.splits = TRUE)
print(plot_hespdiv(changed_hd))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.