Re: [R] ifelse and wildcard matching

2009-12-06 Thread Duncan Murdoch
On 06/12/2009 3:05 PM, Jennifer Brea wrote: Hi, I'm trying to create a new variable using the following code: A$B2<-ifelse(A$B %in% "EDUCATION","EDUCATION",NA) The problem is, I want the new variable to be labeled "EDUCATION" if the original *contains* "EDUCATION", not of it is an exact match

[R] ifelse and wildcard matching

2009-12-06 Thread Jennifer Brea
Hi, I'm trying to create a new variable using the following code: A$B2<-ifelse(A$B %in% "EDUCATION","EDUCATION",NA) The problem is, I want the new variable to be labeled "EDUCATION" if the original *contains* "EDUCATION", not of it is an exact match. I've done a lot of searching on wild card