I have a df
Type Total
Apple 6
Banana 2
Grapes 7
Unidentified 8
I want to replace the Unidentified Type value with another type (Dominant Type) that has the highest Total value. From the above example, Grapes because the Total value of Grapes 7 is the highest from all the other Total values excluding Unidentified
Type Total Dominant Type
Apple 6 NA
Banana 2 NA
Grapes 7 NA
Unidentified 8 Grapes
How would I complete this in dplyr?