My dataset contains two columns with data that are offset – something like:
col1<-c("a", "b", "c", "d", "ND", "ND", "ND", "ND")
col2<-c("ND", "ND", "ND", "ND", "e", "f", "g", "h")
dataset<-data.frame(cbind(col1, col2))
I would like to combine those two offset columns into a single column that contains the letters a through h and nothing else.
Something like the following is what I’m thinking, but rbind is not the right command:
dataset$combine<-rbind(dataset$col1[1:4], dataset$col2[5:8])
What about: