I have a data frame with 9 columns and 100,000 rows. The information in each row is mixed, like in the following example:
C1 <- c("Gender F", "Age 74", "Gender M")
C2 <- c("Age 54", "Gender M", "Col eyes Blue")
C3 <- c("Col eyes Brown","Col eyes Blue", "Age 56")
C4 <- c("Col hair Brown", "Col hair Black", "Col hair Blonde")
df <- cbind(C1, C2, C3, C4)
> df
C1 C2 C3 C4
[1,] "Gender F" "Age 54" "Col eyes Brown" "Col hair Brown"
[2,] "Age 74" "Gender M" "Col eyes Blue" "Col hair Black"
[3,] "Gender M" "Col eyes Blue" "Age 56" "Col hair Blonde"
I would like to make this data frame consistent, in other words, I'd like to have all the "Gender" information in the same column, and so on. I am new in R and struggling to find the solution. Can anybody help?