Skip to contents

pf_internal extracts or assigns a pfc or dgCMatrix into the internal edges of a pfc.

Usage

pf_internal(x, ...)

pf_internal(x) <- value

pf_terminal(x, ...)

pf_terminal(x) <- value

Arguments

x

a pfc object

...

Arguments passed to or from other methods.

value

a pfc or dgCMatrix with the same dimensions as pf_internal(x) or pf_terminal(x)

Value

a pfc object with flows truncated to internal nodes.

Details

pf_terminal extracts or assigns a pfc or dgCMatrix into the terminal edges of a pfc.

Examples

pfc1 <- rpfc(100)
# Pagel's lambda transformation:
lambda <- 0.5
lambda_pfc <- pfc1
root2node_lens <- pf_flow_sum(lambda_pfc)
pf_internal(lambda_pfc) <- pf_internal(lambda_pfc) * lambda
pf_terminal(lambda_pfc) <- pf_terminal(lambda_pfc) * (root2node_lens / pf_flow_sum(lambda_pfc))
plot(lambda_pfc)