Skip to content

Non-list contrasts argument ignored while modeling #35

@hmantovani

Description

@hmantovani

I'm trying to model the Brasileirão 2023 league with the results directly out of the FBRef site, but I can't create the model for some reason I do not understand. I'm getting this message:
In model.matrix.default(~values - 1, model.frame(~values - 1), contrasts = FALSE) : non-list contrasts argument ignored
What could be happening? df is a dataframe with the columns home, hgoal, away, agoal for all the Brasileirão matches

df <-
  worldfootballR::fb_match_results(
    country = "BRA",
    gender = "M",
    season_end_year = 2023,
    tier = "1st") %>%
  janitor::clean_names() %>%
  regista::factor_teams(c("home", "away")) %>%
  rename(hgoal = home_goals,
         agoal = away_goals) %>%
  select(10:11, 13:14)

unplayed_games <- df %>% filter(is.na(hgoal) & is.na(agoal))
played_games <- df %>% filter(!is.na(hgoal) & !is.na(agoal))
model <- dixoncoles(hgoal, agoal, home, away, data = played_games)

It's also happening to the default premier_league_2010 data. Could it be some package conflict?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions