Re: [R] How to find row maximum of two columns

2006-05-11 Thread Rob Steele
Dale Steele wrote: > Hello -- Given the 10x2 matrix below, my goal is to create a vector > which contains the maximum of column 1 and column 2, or the only value > if there is an NA in one column. I experimented with max.col without > success. Thanks. --Dale > > > > tmax.m > tmaxhme tm

Re: [R] How to find row maximum of two columns

2006-05-10 Thread Simon Blomberg
apply(tmax.m, 2, max) Dale Steele wrote: > Hello -- Given the 10x2 matrix below, my goal is to create a vector > which contains the maximum of column 1 and column 2, or the only value > if there is an NA in one column. I experimented with max.col without > success. Thanks. --Dale > > > > tmax.

Re: [R] How to find row maximum of two columns

2006-05-10 Thread Gabor Grothendieck
Try this: pmax(tmax.m[,1], tmax.m[,2], na.rm = TRUE) On 5/10/06, Dale Steele <[EMAIL PROTECTED]> wrote: > Hello -- Given the 10x2 matrix below, my goal is to create a vector > which contains the maximum of column 1 and column 2, or the only value > if there is an NA in one column. I experimente

[R] How to find row maximum of two columns

2006-05-10 Thread Dale Steele
Hello -- Given the 10x2 matrix below, my goal is to create a vector which contains the maximum of column 1 and column 2, or the only value if there is an NA in one column. I experimented with max.col without success. Thanks. --Dale > > tmax.m tmaxhme tmaxer [1,] 101.0 99.8 [2