[R] subseting a data frame

Rui Barradas rui1174 at sapo.pt
Fri Mar 2 17:22:40 CET 2012


Hello,

> HI,
> this is my problem I want to subset this file df, using only  unique
> df$exon printing the line once even if  df$exon appear several times:
> 
> unique(df$exon) will show me the unique exons
> If I try to print only the unique exon lines
> with df[unique(df$exon),] -this doesn't print only the unique ones :(
> 

Try

inx <- match(unique(df$exon), df$exon)
df[inx, ]


Hope this helps,

Rui Barradas


--
View this message in context: http://r.789695.n4.nabble.com/subseting-a-data-frame-tp4438745p4438922.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list