create_tree: Generate a simulated tree

Description Usage Arguments Value

View source: R/simulation_functions.R

Description

Create a simulated tree from a noise sd, named vectors of leaf effects, volumes, individual effects, metadata, and an initial tree

Usage

1
2
create_tree(noise_sd, leaf_effects, leaf_volumes, indiv_effects, metadata,
  base_tree, intercept_sd = 0, extra_effects = NA)

Arguments

noise_sd

What should the sd of the gaussian noise added to observations be

leaf_effects

A named vector of effects to apply to the leaves

indiv_effects

A vector of individual level effects

metadata

A vector containing a covariate with elements matching the elements of the indiv effects / tree volumes.

base_tree

A tree indicating the ontology, should contain volumes already to be overwritten.

extra_effects

A named vector of extra effects to be applied at nodes. Default NA for no extra effects

leaf_volume

A named vector of scaling constants to be applied to the leaf nodes, converting them to volume scale.

Value

A two element list containing

  1. The simulated tree

  2. A vector with the composite leaf_effects generated by adding extra_effects to leaf_effects where applicable.


cfhammill/hierarchyTrees documentation built on Feb. 8, 2020, 2:54 a.m.