Learn R Programming

forestsearch (version 0.1.0)

create_factor_summary_tables: Create Factor Summary Tables from Bootstrap Results

Description

Generates formatted GT tables summarizing factor frequencies from bootstrap subgroup analysis. Creates two complementary tables: one showing factor selection frequencies within each position (M.1, M.2, etc.), and another showing overall factor frequencies across all positions.

Usage

create_factor_summary_tables(factor_freq, n_found, min_percent = 2)

Value

A list with up to two GT table objects:

by_position

GT table showing factor frequencies within each position. Percentages represent conditional probability of factor selection given that the position was populated. Within each position, percentages sum to approximately 100% (may not sum exactly to 100% after filtering).

overall

GT table showing total factor frequencies across all positions. Includes additional columns indicating which positions each factor appeared in and how many unique positions used the factor. Percentages represent proportion of successful iterations where the factor appeared in any position.

If no factors meet the minimum threshold, the corresponding table element will be NULL.

Arguments

factor_freq

Data.frame or data.table. Factor frequency table from summarize_bootstrap_subgroups, containing columns:

  • Position: Position identifier (e.g., "M.1", "M.2")

  • Factor: Factor definition string

  • N: Count of times factor appeared in this position

  • Percent: Percentage relative to times position was populated

n_found

Integer. Number of successful bootstrap iterations (where a subgroup was identified). Used to calculate overall percentages.

min_percent

Numeric. Minimum percentage threshold for including factors in the tables. Factors with selection frequencies below this threshold are excluded. Default is 2 (i.e., 2%).

See Also

  • summarize_bootstrap_subgroups for generating the factor_freq input

  • format_subgroup_summary_tables for creating all subgroup summary tables

  • summarize_bootstrap_results for complete bootstrap analysis workflow

  • forestsearch_bootstrap_dofuture for running bootstrap analysis