> "Anupam" == Anupam Tyagi <[EMAIL PROTECTED]>
> on Mon, 16 Oct 2006 18:15:06 + (UTC) writes:
Anupam> Hi Stephane,
Anupam> Stéphane CRUVEILLER genoscope.cns.fr> writes:
>> is there a way to pass a list of patterns to the grep function? I
>> vaguely remember somethi
Hi Stephane,
Stéphane CRUVEILLER genoscope.cns.fr> writes:
> is there a way to pass a list of patterns to the grep function? I
> vaguely remember something with %in% operator...
I think you are looking for the %in% and %nin% which are part of Design package,
and also in Hmisc library. You have t
> DF <- data.frame(pat = letters[1:3])
> grep(paste(DF$pat, collapse = "|"), letters, value = TRUE)
[1] "a" "b" "c"
On 10/16/06, Stéphane CRUVEILLER <[EMAIL PROTECTED]> wrote:
> Ooops sorry for html tags... Just forgot to edit the message
> before sending it...
> So back to my question:
>
> Thx f
Ooops sorry for html tags... Just forgot to edit the message
before sending it...
So back to my question:
Thx for the hint, but what would I have used if "b","c" and "d"
were values of a dataframe for instance?
X is for instance a dataframe:
>X
Mypatterns
1 pattern1
2 pattern2
3 patte
Thx for the hint, but what would I have used if "b","c" and "d"
were values of a dataframe for instance?
Stéphane.
Gabor Grothendieck a écrit :
> Try this:
>
>> grep("b|c|d", letters, value = TRUE)
> [1] "b" "c" "d"
>
> On 10/16/06, Stéphane CRUVEILLER <[EMAIL PROTECTED]> wrote:
>> Dear R-users,
Try this:
> grep("b|c|d", letters, value = TRUE)
[1] "b" "c" "d"
On 10/16/06, Stéphane CRUVEILLER <[EMAIL PROTECTED]> wrote:
> Dear R-users,
>
> is there a way to pass a list of patterns to the grep function? I
> vaguely remember something with %in% operator...
>
>
> Thanks,
>
>
> Stéphane.
>
>
>
Dear R-users,
is there a way to pass a list of patterns to the grep function? I
vaguely remember something with %in% operator...
Thanks,
Stéphane.
--
"La science a certes quelques magnifiques réussites à son actif mais
à tout prendre, je préfère de loin être heureux plutôt qu'avoir raison.