Sorry, don't know why I didn't just make a tribble of what I want as well...
I want to turn this:
tribble(
~ID, ~test1, ~randomvar, ~test2,
1, "result1", 2, NA,
2, "result1", 1, "result2",
3, "result1", 4, NA,
4, "result1", 8, "result2"
)
into this:
tribble(
~ID, ~test1, ~randomvar, ~test2,
1, "result1", 2, NA,
2, "result1", 1, "result2",
2, "result1", 1, "result2",
3, "result1", 4, NA,
4, "result1", 8, "result2",
4, "result1", 8, "result2"
)
result1 and result2 were just ment as placeholders. The values will vary so I guess I will have to select based on the presence(not NA) in both of them.
Did this make any more sense? 