Skip to content
Prev 205484 / 398506 Next

removing the rows with negative elements

try also this:

x <- matrix(c(2,-1,-2,3,5,6,-3,7,4,2,1,0), 4, 3)
x[!rowSums(x < 0), ]


Best,
Dimitris
faridamsb at gmail.com wrote: