Skip to content
Prev 201389 / 398502 Next

Re moving rows which do not satisfy a condition

Bill Dunlap sent me a couple of more compact versions and perhaps  
forgot the hit "reply all":

  Data[ Data[,1]^2 + Data[,2]^2 >= 49, , drop=FALSE]

And a second one that handles higher dimensions than 2, still with and  
L2 metric:

  Data[ rowSums(Data^2)>49, , drop=FALSE]