I would like to create a new column out of the columns "Score 1" and "Score 2" (see below my data). The new column should be named "Score" and has 14 rows since I would like that after the values from column "Score 1" in columns 8 to 14 the values from column "Score 2" are added.
My data looks like this:
structure(list(`Score 1` = c(1L, 2L, 2L, 3L, 4L, 4L, 2L), `Score 2` = c(3L,
4L, 4L, 3L, 3L, 2L, NA)), class = "data.frame", row.names = c(NA,
-7L))
I tried to do the following:
Data_new <- data.frame(Score=unlist(Data))
This does not work since the two columns don't have the same number of rows.
In the end my data should look like this:
structure(list(Score = c(1L, 2L, 2L, 3L, 4L, 4L, 2L, 3L, 4L,
4L, 3L, 3L, 2L)), class = "data.frame", row.names = c(NA, -13L
))
Could someone help me with the code?