Get a Data Frame Summary of All Leaf Questions
get_questions.Rd
Traverses the tree to find all leaf nodes (questions) and compiles their key attributes into a single, tidy data frame. This is useful for getting a complete overview of the analysis state or for creating custom reports.
Value
A data.frame
with one row for each leaf node and the following
columns: name
, question
, answer
, confidence
(on a 0-5 scale),
and influence_index
.
Examples
# Load the example 'ethical' dataset
data(ethical)
# Build and initialise the tree object
ethical_tree <- load_tree_df(ethical)
ethical_tree <- update_tree(ethical_tree)
# Get the summary data frame of all questions
questions_df <- get_questions(ethical_tree)
# Display the first few rows
head(questions_df)
#> name
#> 1 FIN1
#> 2 FIN2
#> 3 FIN3
#> 4 FIN4
#> 5 FIN5
#> 6 ENV1
#> question
#> 1 Company demonstrates consistent, high revenue growth.
#> 2 Company maintains a high net profit margin for its industry.
#> 3 Company holds a dominant or rapidly growing market share.
#> 4 Debt-to-Equity ratio is below the industry average.
#> 5 Company generates strong and positive free cash flow.
#> 6 Carbon emissions (Scopes 1 & 2) are verifiably below the industry average.
#> answer confidence influence_if_true influence_if_false influence_index
#> 1 NA NA 0.12500000 0.3333333 0.4583333
#> 2 NA NA 0.12500000 0.3333333 0.4583333
#> 3 NA NA 0.12500000 0.3333333 0.4583333
#> 4 NA NA 0.06250000 1.0000000 1.0625000
#> 5 NA NA 0.06250000 1.0000000 1.0625000
#> 6 NA NA 0.08333333 0.5000000 0.5833333