internode_distances: Get internode distances between primary branches from a QSM

View source: R/traits_from_qsm.R

internode_distancesR Documentation

Get internode distances between primary branches from a QSM

Description

This function estimates the internode distance between primary branches from a QSM. It filters out all primary branches 'branching_order == 1' calculates their attachment points (Z) to the trunk, and then returns the distances betweent the branches

Usage

internode_distances(qsm, min_diam = 2)

Arguments

qsm

a QSM loaded using '[load_qsm()]'.

min_diam

numeric - minimum diameter (in cm) to include branch

Value

A numeric vector of internode distances (m) between consecutive primary branches that meet the diameter threshold. Returns 'NA' if fewer than two qualifying primary branches are present.

Examples

qsm_file = system.file("extdata", "tree_0744_qsm.txt", package='tReeTraits')
qsm = load_qsm(qsm_file)
inodes = internode_distances(qsm)
print(inodes)
median(inodes)

tReeTraits documentation built on Feb. 26, 2026, 1:07 a.m.