mentor_ wrote: > > Hi, > > if I have a large matrix e.g. with the dimensions of 1000 rows and 10 > columns. > How can I select rows comprising one or more values between a specific > range of two values? > So e.g. a row has one or more values between the range of 100 - 120. >
No tested, but this should work (say your matrix is called "mat"): mat[apply(mat, 1, function(x) any(x > 99 & x < 121)), ] Hth, Adrian -- View this message in context: http://www.nabble.com/Select-specific-rows-of-a-matrix-tp20398347p20404257.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.