[R] subset

Guenther, Cameron Cameron.Guenther at MyFWC.com
Tue May 16 20:37:02 CEST 2006


Hello everyone,

I have a large dataset (x) with some rows that have duplicate variables
that I would like to remove.  I find which rows are the duplicates with
X1<-which(duplicated(x)).  That gives me the rows with duplicated
variables.  Now, how can I remove just those rose from the original data
frame.  I think I can create a new data frame without the duplicates
using subset.  I have tried:
Subset(x,!x1) and subset(x,!x[x1,])
I can't seem to find the correct syntax.  Any advice.
Thanks in advance

Cameron Guenther, Ph.D. 
Associate Research Scientist
FWC/FWRI, Marine Fisheries Research
100 8th Avenue S.E.
St. Petersburg, FL 33701
(727)896-8626 Ext. 4305
cameron.guenther at myfwc.com




More information about the R-help mailing list