Modelling team strengths often requires separate parameters for offence and defence. These helper functions provide a quick way to turn a factor of team names into a factor of offence or defence levels

off(x)

def(x)

Arguments

x

A factor containing team names

Examples

teams <- factor(c("Arsenal", "Liverpool", "Barcelona", "Dortmund")) off(teams)
#> [1] off___Arsenal off___Liverpool off___Barcelona off___Dortmund #> Levels: off___Arsenal off___Barcelona off___Dortmund off___Liverpool
#> [1] off___Arsenal off___Liverpool off___Barcelona off___Dortmund #> Levels: off___Arsenal off___Barcelona off___Dortmund off___Liverpool