Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Dirk Eddelbuettel
On 2 July 2009 at 09:13, Neil Tiffin wrote: | Given a array of string values, for example lets say "mary", "bob", | "danny", "sue", and "jane". | | I am trying to determine how to perform a logical test to determine if | a variable is an exact match for one of the string values in the array

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Neil Tiffin
Worked like a champ. Thank you. Neil On Jul 2, 2009, at 9:20 AM, Henrique Dallazuanna wrote: > Try this: > > c("mary", "sue") %in% c("mary", "bob", "danny", "sue","jane") > > On Thu, Jul 2, 2009 at 11:13 AM, Neil Tiffin > wrote: > As an R beginner, I feel brain dead today as I can not find t

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Marc Schwartz
On Jul 2, 2009, at 9:13 AM, Neil Tiffin wrote: As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say "mary", "bob", "danny", "sue", and "jane". I am trying to determine how to perform a

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Henrique Dallazuanna
Try this: c("mary", "sue") %in% c("mary", "bob", "danny", "sue","jane") On Thu, Jul 2, 2009 at 11:13 AM, Neil Tiffin wrote: > As an R beginner, I feel brain dead today as I can not find the answer to a > relatively simple question. > > Given a array of string values, for example lets say "mary"