I ran an experiment with 3 conditions. The data is currently organized like this:

```
| X | Y | Z |
|   | 1 |   |
|   | 0 |   |
| 0 |   |   |
| 0 |   |   |
|   |   | 1 |
|   |   | 1 |

```

I would like it to look like this:

```
| Y | 1 |
| Y | 0 |
| X | 0 |
| X | 0 |
| Z | 1 |
| Z | 1 |

```

This is because it seems like a lot of analysis requires it in this format.

I am hoping there may be a function which does this transformation, as it seems like it might be rather common.

Edit:

I tried using the reshape suggestion below, but am having issues. It does not seem to be effecting the structure. My data must somehow be different from the constructed test data, but I am not sure how.

I am having some trouble with this and thought maybe you could help.

```
> simpleGame
   Q6.4 Q7.4 Q8.4
3               2
5               2
8          1     
11              2
13         1     
14    2          
16              1
17         1     
19    2          
23    2          
24              1
26    2          
28    2    

```

But When I run melt, it does not seem to change anything:

```
> na.omit(melt(simpleGame))
Using Q6.4, Q7.4, Q8.4 as id variables
   Q6.4 Q7.4 Q8.4
1               2
2               2
3          1     
4               2
5          1     
6     2          
7               1
8          1     
9     2          
10    2          
11              1
12    2          
13    2   

```

Any suggestions would be much appreciated.

Edit2: As requested, here is the dput of the data frame:

```
> dput(simpleGame)
structure(list(Q6.4 = structure(c(1L, 1L, 1L, 1L, 1L, 3L, 1L, 
1L, 3L, 3L, 1L, 3L, 3L), .Label = c("", "1", "2", "Which do you choose?"
), class = "factor"), Q7.4 = structure(c(1L, 1L, 2L, 1L, 2L, 
1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L), .Label = c("", "1", "2", "Which do you choose?"
), class = "factor"), Q8.4 = structure(c(3L, 3L, 1L, 3L, 1L, 
1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L), .Label = c("", "1", "2", "Which do you choose?"
), class = "factor")), .Names = c("Q6.4", "Q7.4", "Q8.4"), row.names = c(3L, 
5L, 8L, 11L, 13L, 14L, 16L, 17L, 19L, 23L, 24L, 26L, 28L), class = "data.frame")

```

I am thinking maybe it has something to do with the fact that these are actually factors? I don't know how to coerce an entire data.frame in to numeric, but I am thinking maybe that will do it.