Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Erik Iverson
x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to keep the rows where these three countries #are involved

Re: [R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Henrique Dallazuanna
Try this: test[rowSums(mapply('%in%', test[c('x', 'y')], list(c('germany','england','brazil' > 0,] On Fri, Jun 25, 2010 at 4:00 PM, Yi wrote: > Hi, folks, > > Finally Friday~~ Here comes the question: > > x=c('germany','poor italy','usa','england','poor italy','japan') > y=c('Spain','german

[R] Delete rows in the data frame by limiting values in two columns

2010-06-25 Thread Yi
Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil'). I would like to ke