> Well, here's one way that "might" work (explanation below):
>
> The ideas is to turn each row into a character vector and then work with the
> two character vectors.
>
>> bigs <- do.call(paste,TheBigOne)
>> ix <- which(bigs %in% setdiff(bigs,do.call(paste,TheLittleOne)))
>> TheBigOne[ix,]
>
> Ho
Try this also:
TheBigOne[rowSums(!mapply(is.element, TheBigOne, TheLittleOne)) > 0,]
On Thu, Jul 29, 2010 at 3:38 PM, BaKaLeGuM wrote:
> Hi everybody !
>
> little question.
>
> I have 2 dataset
>
> TheLittleOne<-data.frame(cbind(c(2,3),c(2,3)))
> TheBigOne<-data.frame(cbind(c(1,1,2),c(1,1,2)))
perfect !
thx
( I found prob::setdiff too.. but not really what i want)
2010/7/29 Hadley Wickham
> Here's one way, using a function from the plyr package:
>
> TheLittleOne<-data.frame(cbind(c(2,3),c(2,3)))
> TheBigOne<-data.frame(cbind(c(1,1,2),c(1,1,2)))
>
> keys <- plyr:::join.keys(TheBigO
Well, here's one way that "might" work (explanation below):
The ideas is to turn each row into a character vector and then work with the
two character vectors.
> bigs <- do.call(paste,TheBigOne)
> ix <- which(bigs %in% setdiff(bigs,do.call(paste,TheLittleOne)))
> TheBigOne[ix,]
However, this ma
Here's one way, using a function from the plyr package:
TheLittleOne<-data.frame(cbind(c(2,3),c(2,3)))
TheBigOne<-data.frame(cbind(c(1,1,2),c(1,1,2)))
keys <- plyr:::join.keys(TheBigOne, TheLittleOne)
!(keys$x %in% keys$y)
TheBigOne[!(keys$x %in% keys$y), ]
Hadley
On Thu, Jul 29, 2010 at 1:38
Hi everybody !
little question.
I have 2 dataset
TheLittleOne<-data.frame(cbind(c(2,3),c(2,3)))
TheBigOne<-data.frame(cbind(c(1,1,2),c(1,1,2)))
And I would like to obtain the TheBigOne - TheLittleOne (the row in
TheBigOne not in TheLittleOne
The result should be:
cbind(c(1,1),c(1,1))
Have yo
6 matches
Mail list logo