Suppose I have the following table:
_ Male Female Total
Pay_with_cash 55 15 70
Use_a_credit_card 60 40 100
Total 115 55 170
How can I convert this to a dataset with 55 rows for males that pay with cash, 15 rows for females that pay with cash, etc? I want there to be only two variables: gender and payment type. Is this possible in R? Although this is not showing up as a table in this interface, please imagine a contingency table.