I have a large data frame with including several trials. I want a new column with the best trial out of the three. They are strings and should be ordered as good, fair and bad.
df <- data.frame(id = c(1:5),
filler = c("You", "can", "ignore", "this", "one"),
trial1 = c("good", NA, "good", "fair", NA),
trial2 = c("bad", "bad", "fair", "NA", NA),
trial3 = c("bad", "bad", "bad", "bad", NA))
In this example, this would mean for the new column and each ID: good, bad, good, fair, NA