add_scorerWeights_to_criteriaTree: Add weights of a scorer to criteria tree

Description Usage Arguments Value

View source: R/add_scorerWeights_to_criteriaTree.R

Description

This function takes scorer weights and adds them to the criteria tree. NOTE: the criteria tree is an R6 object. Therefore, when this function is called, the object will be changed in memory; i.e. the '$criteriaTree' 'data.tree' object that is passed in 'criteria' is passed by _reference_, not by value (the default for normal R objects).

Usage

1
2
3
4
5
6
7
8
add_scorerWeights_to_criteriaTree(
  weights,
  scorer,
  criteria,
  rootWeight = 1,
  rootParentCriterion_id = "-",
  weightName = paste0(scorer, "_weight")
)

Arguments

weights

The weights object.

scorer

The scorer id (a character value).

criteria

The criteria object.

rootWeight

The weight for the root (normally, 1).

rootParentCriterion_id

The identifier of the root.

weightName

The name to use for the variable with these weights.

Value

A dataframe with weights (invisibly). Note the updated criteria tree: that, after all, is changed in memory because it's passed by reference instead of by value.


Matherion/mdmcda documentation built on Dec. 31, 2020, 3:13 p.m.