Use lapply to a vector of risk factors and return a vector of scores.

get_score(riskfactor, values, scores)

get_score_vec(rf_vec, values, scores)

Arguments

riskfactor

Raw risk factor.

values

Specified risk factors.

scores

Specified score according to the value.

rf_vec

A vector of risk factors

Value

A numeric score.

A vector of score

Examples

values <- c(55, 60, 65, 70, 75, 80, 85, 90, 95, 100) scores <- c(1.0000, 0.9747, 0.8967, 0.8303, 0.7730, 0.7232, 0.6793, 0.6405, 0.6059, 0.5748) get_score(57.5, values, scores) # 0.98735
#> [1] 0.98735
get_score(97.5, values, scores) # 0.59035
#> [1] 0.59035
get_score(77, values, scores) # 0.75308
#> [1] 0.75308
get_score_vec(c(57.5, 97.5,77), values, scores)
#> [1] 0.98735 0.59035 0.75308