Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread David Winsemius
On May 10, 2011, at 9:49 AM, noxyp...@gmail.com wrote: On Tue, May 10, 2011 at 3:09 PM, David Winsemius > wrote: On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: On Fri, May 6, 2011 at 7:41 PM, David Winsemius > wrote: On May 6, 2011, at 11:35 AM, Pete Pete wrote: Gabor Grothendi

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Tue, May 10, 2011 at 3:09 PM, David Winsemius wrote: > > On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: > > On Fri, May 6, 2011 at 7:41 PM, David Winsemius >> wrote: >> >>> >>> On May 6, 2011, at 11:35 AM, Pete Pete wrote: >>> >>> Gabor Grothendieck wrote: > > On Tue

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Tue, May 10, 2011 at 3:09 PM, David Winsemius wrote: > > On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: > >> On Fri, May 6, 2011 at 7:41 PM, David Winsemius >> wrote: >>> >>> On May 6, 2011, at 11:35 AM, Pete Pete wrote: >>> Gabor Grothendieck wrote: > > On Tue, Dec 7

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread David Winsemius
On May 10, 2011, at 3:18 AM, noxyp...@gmail.com wrote: On Fri, May 6, 2011 at 7:41 PM, David Winsemius > wrote: On May 6, 2011, at 11:35 AM, Pete Pete wrote: Gabor Grothendieck wrote: On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete wrote: Hi, consider the following tw

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-10 Thread noxyp...@gmail.com
On Fri, May 6, 2011 at 7:41 PM, David Winsemius wrote: > > On May 6, 2011, at 11:35 AM, Pete Pete wrote: > >> >> Gabor Grothendieck wrote: >>> >>> On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete >>> wrote: Hi, consider the following two dataframes: x1=c("232","3

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-06 Thread David Winsemius
On May 6, 2011, at 11:35 AM, Pete Pete wrote: Gabor Grothendieck wrote: On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete wrote: Hi, consider the following two dataframes: x1=c("232","3454","3455","342","13") x2=c("1","1","1","0","0") data1=data.frame(x1,x2) y1=c("232","232"

Re: [R] Creating binary variable depending on strings of two dataframes

2011-05-06 Thread Pete Pete
Gabor Grothendieck wrote: > > On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete > wrote: >> >> Hi, >> consider the following two dataframes: >> x1=c("232","3454","3455","342","13") >> x2=c("1","1","1","0","0") >> data1=data.frame(x1,x2) >> >> y1=c("232","232","3454","3454","3455","3

Re: [R] Creating binary variable depending on strings of two dataframes

2010-12-07 Thread Santosh Srinivas
your question is not clear to me .. but your solution is a variation of > data1$x.1 <- data1$x1 %in% data2$y1 you can play with your conditions to get the result you want On Tue, Dec 7, 2010 at 10:00 PM, Pete Pete wrote: > > Hi, > consider the following two dataframes: > x1=c("232","3454","3455

Re: [R] Creating binary variable depending on strings of two dataframes

2010-12-07 Thread Gabor Grothendieck
On Tue, Dec 7, 2010 at 11:30 AM, Pete Pete wrote: > > Hi, > consider the following two dataframes: > x1=c("232","3454","3455","342","13") > x2=c("1","1","1","0","0") > data1=data.frame(x1,x2) > > y1=c("232","232","3454","3454","3455","342","13","13","13","13") > y2=c("E1","F3","F5","E1","E2","H4",

[R] Creating binary variable depending on strings of two dataframes

2010-12-07 Thread Pete Pete
Hi, consider the following two dataframes: x1=c("232","3454","3455","342","13") x2=c("1","1","1","0","0") data1=data.frame(x1,x2) y1=c("232","232","3454","3454","3455","342","13","13","13","13") y2=c("E1","F3","F5","E1","E2","H4","F8","G3","E1","H2") data2=data.frame(y1,y2) I need a new column i

Re: [R] Creating binary variable depending on strings of two dataframes

2010-12-07 Thread David Winsemius
On Dec 7, 2010, at 11:30 AM, Pete Pete wrote: Hi, consider the following two dataframes: x1=c("232","3454","3455","342","13") x2=c("1","1","1","0","0") data1=data.frame(x1,x2) y1=c("232","232","3454","3454","3455","342","13","13","13","13") y2=c("E1","F3","F5","E1","E2","H4","F8","G3","E1","H