Skip to content
Back to formatted view

Raw Message

Message-ID: <D1F24055.1351BB%macqueen1@llnl.gov>
Date: 2015-08-13T19:42:00Z
From: MacQueen, Don
Subject: String Matching
In-Reply-To: <5fabd36a-ed1d-4e66-a77f-05e24bc9b0e6@me.com>

I haven't tested this, but what about:


df <- data.frame(mtch=c(matchString, string1, string2))

grep(searchString, df$mtch, ignore.case=FALSE)

Depending on what your next step is, you might prefer grepl.


Sometimes using fixed=TRUE in grep() helps.

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 8/12/15, 8:51 AM, "R-help on behalf of Kevin Kowitski"
<r-help-bounces at r-project.org on behalf of k.kowitski at icloud.com> wrote:

>>df<-as.data.frame(c(matchString, string1, string2))
>>df
>                                                         c(matchString,
>string1, string2)
>1 09:11:57.259 - Assay File Processing Thread - INFO -
>SolenoidCycleMessage: Addr = 0x03
>2                 
>23:12:43.22 - Test
>3                 
>           test
>>grep(searchString, df, ignore.case=FALSE)
>i