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. 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.
Edited: I added a 6th row to indicate that in case of all 'NA' in row, I would like to get 'NA' and not 'Errors' in my 'Summary' column. Sorry if this was not clear in my first post.