treeprune

0th

Percentile

Prune Tree to Given Level

Prune a tree by removing all the branches above a given level.

Keywords
manip, spatial
Usage
treeprune(X, root = 1, level = 0)
Arguments
X
Object of class "linnet" or "lpp".
root
Index of the root vertex amongst the vertices of as.linnet(X).
level
Integer specifying the level above which the tree should be pruned.
Details

The object X must be either a linear network, or a derived object such as a point pattern on a linear network. The linear network must be an acyclic graph (i.e. must not contain any loops) so that it can be interpreted as a tree. This function removes all vertices for which treebranchlabels gives a string more than level characters long.

Value

  • Object of the same kind as X.

See Also

linnet

Aliases
  • treeprune
Examples
example(treebranchlabels)
  tp <- treeprune(L, 1)
  plot(tp, add=TRUE, col="blue")
Documentation reproduced from package spatstat, version 1.42-2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.