Re: [R] looking for 'tied rows' in dataframe

2019-03-19 Thread Evan Cooch
Good suggestion, and for my purposes, will solve the problem. Thanks! On 3/18/2019 12:37 PM, Ben Tupper wrote: > 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

Re: [R] looking for 'tied rows' in dataframe

2019-03-18 Thread Ben Tupper
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 > On Mar 17, 2019,

Re: [R] looking for 'tied rows' in dataframe

2019-03-18 Thread Evan Cooch
Solved -- hold=apply(test,1,which.max)     hold[apply(test,1,isUnique)==FALSE] <- 'T' Now, all I need to do is figure out how to get <- 'T' from turning everything in the matrix to a string. On 3/17/2019 8:00 PM, Evan Cooch wrote: Got relatively close - below: On 3/17/2019 7:39 PM, Evan

Re: [R] looking for 'tied rows' in dataframe

2019-03-18 Thread Evan Cooch
Got relatively close - below: On 3/17/2019 7:39 PM, Evan Cooch wrote: Suppose I have the following sort of structure: test <- matrix(c(2,1,1,2,2,2),3,2,byrow=T) What I need to be able to do is (i) find the maximum value for each row, (ii) find the column containing the max, but (iii) if the

[R] looking for 'tied rows' in dataframe

2019-03-18 Thread Evan Cooch
Suppose I have the following sort of structure: test <- matrix(c(2,1,1,2,2,2),3,2,byrow=T) What I need to be able to do is (i) find the maximum value for each row, (ii) find the column containing the max, but (iii) if the maximum value is a tie (in this case, all numbers of the row are the