Hello,
this is a very simple question:
How can I find out if a word is part of a list of words
like:
a - word1
b - word4
vector - c(word1,word2,word3)
I tried it with match(a,vector)
but this gives the position of the word.
I am not sure if and how that can be
done with a logical operator
Hi
Hello,
this is a very simple question:
How can I find out if a word is part of a list of words
like:
a - word1
b - word4
vector - c(word1,word2,word3)
I tried it with match(a,vector)
but this gives the position of the word.
Perhaps
a %in% vector
Regards
Petr
I am not
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 20/01/12 12:50, Johannes Radinger wrote:
Hello,
this is a very simple question: How can I find out if a word is
part of a list of words
like: a - word1 b - word4
vector - c(word1,word2,word3)
I tried it with match(a,vector) but this
Hi,
thank you very much... %in% is the operator I was looking for.
cheers,
johannes
Original-Nachricht
Datum: Fri, 20 Jan 2012 13:01:54 +0100
Von: Rainer M Krug r.m.k...@gmail.com
An: Johannes Radinger jradin...@gmx.at
CC: R-help@r-project.org
Betreff: Re: [R] test if
You also might look at grepl() if you have time: it allows regular expressions
and will be a little (a lot?) more flexible in how you define a match if you
want to ignore things like capitalization.
(mnemonic: the L in grepl indicates its like grep but returns logicals instead
of positions)
5 matches
Mail list logo