Skip to content
Prev 378945 / 398502 Next

looking for 'tied rows' in dataframe

Hi,

Might you replaced 'T' with a numeric value that signals the TRUE case without rumpling your matrix?  0 might be a good choice as it is never an index for a 1-based indexing system.

hold=apply(test,1,which.max)
hold[apply(test,1,isUnique)==FALSE] <- 0
hold
[1] 1 2 0
Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/