What I want is to refer to another value in the same tibble and mutate the initial value into that. Let's say for instance I am having a tibble as follows:
tibble(x = 200:203, y = c("a","b","c", "d"), z = c(NA, 202,201,NA))
And from that I want to get the following as the result:
tibble(x = 200:203, y = c("a","b","c", "d"), z = c(NA, "c","b",NA))
I have tried the following but it doesn't work.
mutate(tbl,z, ifelse(!is.na(z), tbl[[which(fixed_messages$id == z),2]], NA))