gt; -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Glenn
> Schultz
> Sent: Friday, January 29, 2016 6:02 PM
> To: R Help R
> Subject: [R] String Matching
>
> All,
>
> I have a file named as so 313929BL4FNMA2432.rds the user may
t six?
>
>> substr(id, nchar(id)-6, nchar(id))=="432.rds"
> [1] TRUE
>>
>
> Cheers
> Petr
>
>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Glenn
>> Schultz
>> Sent: Friday, Ja
On 29/01/2016 12:02 PM, Glenn Schultz wrote:
All,
I have a file named as so 313929BL4FNMA2432.rds the user may pass either the
first 9 character or the last six characters. I need to match the remainder of
the file name using either the first nine or last six. I have read the help
files fo
All,
I have a file named as so 313929BL4FNMA2432.rds the user may pass either the
first 9 character or the last six characters. I need to match the remainder of
the file name using either the first nine or last six. I have read the help
files for Regular Expression as used in R and I think
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 Na
Hi Kevin,
It's not totally clear to me what the desired output is.
grep(searchString, matchString, ignore.case=FALSE)
told you that searchString is in the first element of matchString.
Isn't that what you want to know? If not, perhaps you can be more
specific about what the desired result is.
B
Hey everyone,
I have been having an issue trying to find a specific string of text in a log
of system messages. I have tried to use pmatch, match, and some regular
expressions but all to no avail.
I have a matrix / data.frame (either one, the file outputs a tens of thousands
of rows wit
7 matches
Mail list logo