I have the columns "male" and "female" in a data.frame
. The rows of these columns are numbers.
To make it more tidy, I would like to add a new column "gender" for male/female and right next to it, I want to combine the both existing columns "male" and "female" (with the numbers in it).
How can I do that? I tried bind_rows()
and mutate()
but failed.