Skip to content
Prev 318637 / 398503 Next

Help searching a matrix for only certain records

Thank you for your response Jim! I will give this one a try! But a couple followup questions...

In my search for a solution, I had seen something stating match() is much more efficient than subset() and will cut down significantly on computing time. Is there any truth to that?

Also, I found the following solution which works for matching a single condition, but I couldn't quite figure out how to ?modify it it to search for both my acceptable conditions...
-Matt
--- On Sun, 3/3/13, jim holtman <jholtman at gmail.com> wrote:
From: jim holtman <jholtman at gmail.com>
Subject: Re: [R] Help searching a matrix for only certain records
To: "Matt Borkowski" <mathias1979 at yahoo.com>
Cc: r-help at r-project.org
Date: Sunday, March 3, 2013, 8:00 AM

Try this:

dataset <- subset(dataset, grepl("(SAO |FL-15)", REC.TYPE))
On Sun, Mar 3, 2013 at 1:11 AM, Matt Borkowski <mathias1979 at yahoo.com> wrote: