I have an issue in adding one column below another column.
i have a data like this :
| Heading 1 | Heading 2 | Value |
|---|---|---|
| 12 | 34 | 1 |
| 99 | 42 | 0 |
and I want that column 2 be below 1:
| Heading 1 | value |
|---|---|
| 12 | 1 |
| 99 | 0 |
| 34 | 1 |
| 42 | 0 |
do you have a suggestion?
thank you in advance
>Solution :
You could do
data.frame(Heading = c(df$`Heading 1`, df$`Heading 2`), value = rep(df$Value, 2))
#> Heading value
#> 1 12 1
#> 2 99 0
#> 3 34 1
#> 4 42 0