R/get_leaves.r

#' get_leaves
#'
#' Get the leaf sequences
#'
#' @param x a lineage_tree object
#' @param ... additional parameters
#'
#' @return a phyDat object
#'
#' @export
#'
setMethod(
	'get_leaves',
	signature(
		x = 'lineage_tree'
	),
	function(
		x,
		...
	){
		is_leaf <- degree(x@graph, mode = 'out') == 0
		x@x[is_leaf]
	}
) # get_leaves

Try the DCLEAR package in your browser

Any scripts or data that you put into this service are public.

DCLEAR documentation built on Sept. 14, 2023, 9:09 a.m.