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
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
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
3 matches
Mail list logo