I would like to refer to another value in the same tibble and mutate my initial value into that. For example if I have a tibble,
tibble(x = 200:203, y = c("a","b","c", "d"), z = c(NA, 202,201,NA))
I would like to get
tibble(x = 200:203, y = c("a","b","c", "d"), z = c(NA, "c","b",NA))
as a result.
I have tried mutate(tbl,z, ifelse(!is.na(z), tbl[[which(fixed_messages$id == z),2]], NA))
but it doesn't work.
Also how do I insert a tibble into a stackoverflow question?
dput(...)
, see stackoverflow.com/questions/5963269/… – Bas