I have this type of dataset
DF
V1 V2 V3
1. A AAA B
2. BBB B CC
3. C BB CCC
And I would like to select the longest string from DF and put it into the new column WINNER like this:
DF
V1 V2 V3 WINNER
1. A AAA B AAA
2. BBB B CC BBB
3. C BB CCC CCC
I have tried
mutate( WINNER = select(which.max (c(nchar(V1), nchar(V2), nchar(V3)))
but it works only for numeric values. I would prefer dplyr solution.