Dear list,

I have been struggling for some time now with this code... I have this vector 
of unique ID "EID" of length 821 extracted from one of my dataframe (skate). It 
looks like this:

> head(skate$EID)
[1] "896-19" "895-8"  "899-1"  "899-5"  "899-8"  "895-7" 
I would like to remove the complete rows in another dataframe (t5) if any of 
the t5$EID is equal (a duplicate) of skate$EID.

I was able to get my 'duplicated' dataframe in t5 of all my matching EID as 
follow:

> xx<-skate$EID
> t5[match(xx,t5[,26]), ]#gives me a dataframe of all matching EID in skate$EID
       record.t trip set month stratum NAFO unit.area time dur.set distance
8948          5  896  19    11     221   2J       N12  908      15        8
8849          5  895   8    10     766   3O       R36 1650      16        8
9289          5  899   1    12     743   3L       V26 2052      15        8
9299          5  899   5    12     746   3L       W27 1129      14        7
Where t5[,26] correspond to t5$EID column. I'm sure it's simple, but I'm not 
sure how to remove all of these now from my t5 dataframe! Tips would be very 
much appreciated! 

Thank you!




Aurelie Cosandey-Godin
Ph.D. student, Department of Biology
Industrial Graduate Fellow, WWF-Canada
Dalhousie University | Email: god...@dal.ca 


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to