[R] unique rows

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Jan 29 15:21:59 CET 2005


"John Fox" <jfox at mcmaster.ca> writes:

> Dear Dax,
> 
> I'll bet that someone comes up with a better approach, but the following
> does appear to work:
> 
> u <- unique(t(sapply(as.data.frame(t(h)), sort)))

Or maybe just

unique(t(apply(h,1,sort)))


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list