'combine two or more columns in a data frame [closed]
I have two columns which look like this
country A - 1 1 1 2 1 1 2 2 1 country B - 1 2 1 1 1 2 2 1 1
all the "1" in each column represent a Yes to a survey and the "2" represent a No to the same survey. I Will like to combine both columns into one column such that the yes in country A is numbered "1" and the yes in country B numbered "2". that is all the "1" in country 2 appear in the combined column as a figure 2. so i can plot a graph of the yes in each country
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
