I apologize if I post a similar question to one I asked earlier, but I realized that my original question wasn't very clear.
I have a dataframe with five columns and 6 rows (actually they are many more, just trying to simplify matters):
One Two Three Four Five
Cat NA NA NA NA
NA Dog NA NA NA
NA NA NA Mouse NA
Cat NA Rat NA NA
Horse NA NA NA NA
NA NA NA NA NA
Now, I would like to coalesce all the information in a new single column ('Summary'), like this:
Summary
Cat
Dog
Mouse
Error
Horse
NA
Please note the 'Error' reported on the fourth Summary row, because two different values have been reported during the merging.Also please note that in case there are only NAs in a row, it should be reported 'NA' and not 'Error' I tried to look at the 'coalesce' function in the dplyr package, but it really desn't seem to do what I need. Thanks in advance.