% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/remove_splits.R
\name{remove_splits}
\alias{remove_splits}
\title{Remove split-lines}
\usage{
remove_splits(obj, split.id, depend.splits = TRUE)
}
\arguments{
\item{obj}{hespdiv object}

\item{split.id}{vector of split-line ids}

\item{depend.splits}{logical. Remove split-lines that depend on specified
split-lines? If FALSE, only end-nodes of spatial dendrogram are removed.}
}
\value{
hespdiv object
}
\description{
Function returns hespdiv object, without split-lines of
specified id.
}
\examples{
\donttest{
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))
}
}
}
