Skip to content
Prev 201367 / 398502 Next

Re moving rows which do not satisfy a condition

On Nov 23, 2009, at 2:57 PM, sandsky wrote:

            
> Data[apply(Data, 1, function(x) sqrt(x[1]^2+x[2]^2)>=7), ]
      [,1] [,2]
[1,]    2    7
[2,]    3    8
[3,]    4    9
[4,]    5   10
David Winsemius, MD
Heritage Laboratories
West Hartford, CT