Skip to content
Prev 318645 / 398503 Next

Help searching a matrix for only certain records

there are way "more efficient" ways of doing many of the operations , but you probably won't see any differences unless you have very large objects (several hunfred thousand entries), or have to do it a lot of times.  My background is in computer performance and for the most part I have found that the easiest/mostbstraight forward ways are fine most of the time.

a more efficient way might be:

testdata <- testdata[match(c('SAO ', 'FL-15'), testdata$REC.TYPE), ]

you can always use 'system.time' to determine how long actions take.

for multiple comparisons use %in%

Sent from my iPad
On Mar 3, 2013, at 9:22, Matt Borkowski <mathias1979 at yahoo.com> wrote: