make_tree_data: Construct dataset for use in 'model_tree'

View source: R/model-tree.R

make_tree_dataR Documentation

Construct dataset for use in model_tree

Description

Construct dataset for use in model_tree

Usage

make_tree_data(
  .log_df,
  include_info = c("description", "star", "tags"),
  color_by = "run",
  size_by = NULL,
  add_summary = TRUE
)

Arguments

.log_df

a bbr run log

include_info

A vector of columns present in .log_df to include in the tooltip.

color_by

A run log column to color the nodes by. Can be helpful for identifying which models are starred, have heuristics, etc. See details for more information.

size_by

A numeric (or integer) run log column to size the nodes by. If not specified, the default is to size the nodes based on how many models are based on it.

add_summary

Logical (TRUE/FALSE). If TRUE, include key columns from model_summary() output.

Details

This function does the following things:

  • Performs checks on required columns

  • Unnests nested columns (such as based_on and tags)

    • Both character ('Two CMT') and list (AMT: nmol) tags are supported

  • Formats columns and performs prep work for creating a tooltip

  • Creates a model network using the based_on column. If additional based_on models were used, the first one will be used to create the network; the rest will be stored in a separate addl_based_on column.

    • This is represented via the from and to columns.

Value

a dataframe


metrumresearchgroup/bbr documentation built on March 29, 2025, 1:08 p.m.