Does anyone know a tidyverse way to calculate expected frequencies for chi squared test of independence on the following data?

```
library(tidyverse)
sex <- c("F", "F", "F", "M", "M", "M")
voting <- c("D", "I", "R", "D", "I", "R")
n <- c(200, 150, 50, 250, 300, 50)
data <- tibble(sex, voting, n) %>%
pivot_wider(names_from = voting, values_from = n) %>%
janitor::adorn_totals(c("row", "col"))
```

I'm aware you can calculate the test statistic and p-value using `janitor::chisq.test`

, but I wanted to see if I could calculate it the long way