Skip to contents

Reduce constraint coefficient for one specific tag_outcome

Usage

reduce_constr(data_constr_coef, tag_outcome_reduce, coef_reduce)

Arguments

data_constr_coef

A dataframe where constraint coefficients are stored

tag_outcome_reduce

Name of the tag_outcome to reduce

coef_reduce

Numeric value to multiply the constraint coefficients of the selected tag_outcome

Value

A dataframe with tag_outcome with the updated coefficients.

Examples

tag_outcomes <- c('energy', 'protein', 'ghge')
constr_coef_df <- set_constr_coef(tag_outcome = tag_outcomes, 
  coef_lwr = rep(0.9, length(tag_outcomes)), 
  coef_upr = rep(1.0, length(tag_outcomes)))
# reduce the coefficients of ghge to 90% its original value
reduce_constr(data_constr_coef = constr_coef_df, 
  tag_outcome_reduce = 'ghge', 
  coef_reduce = 0.9)
#>   tag_outcome coef_constrlwr coef_construpr
#> 1      energy           0.90            1.0
#> 2     protein           0.90            1.0
#> 3        ghge           0.81            0.9