Skip to contents

Clips skill to soft bounds to prevent extreme values.

Usage

bound_skill(skill, skill_type = "run", entity_type = "player")

Arguments

skill

Numeric. Current skill value.

skill_type

Character. "run" or "wicket".

entity_type

Character. "player" or "venue".

Value

Numeric. Bounded skill value.

Examples

bound_skill(0.3, "run", "player")
#> [1] 0.3
bound_skill(0.8, "run", "player")  # Capped to max
#> [1] 0.5
bound_skill(0.01, "wicket", "venue")
#> [1] 0.01