I have this df
Genero Frustrado No frustrado
<chr> <int> <int>
Hombre 138 9
Mujer 145 12
And I need to turn it into a contingency table like this:
Frustrado
Genero Si No
Hombre 138 9
Mujer 145 12
How can I do it with a simple code chunk? (I need to replicate this many times and I would prefer not to write vectors every time)
Thanks!
Maybe you can try the code below
which gives
Data