While adding the variable, assigning the value, filtering and changing the value of the variable, I lost the rest of the observations.
structure(list(uci = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("10001h",
"10268h", "10431h"), class = "factor"), wave = c(1L, 2L, 3L,
4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L,
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
15L, 16L, 17L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L,
12L, 13L, 14L, 15L, 16L, 17L), date = structure(c(17042, 17053,
17060, 17074, 17086, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, 17003, 17010, 17015, 17055, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, 16994, 17000, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA), class = "Date"), session = c(1L,
2L, 3L, 4L, 5L, 6L, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
1L, 2L, 3L, 4L, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, 1L, 2L, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA)), class = "data.frame", row.names = c(NA, -51L))
I'm sure this is possible but I just cannot figure it out. Does anyone have a solution to my problem?