Yep. There are methods for:

> methods(unique)
[1] unique.array           unique.data.frame      unique.default        
[4] unique.matrix          unique.numeric_version unique.POSIXlt   

and for the matrix and data.frame methods, unique rows will be returned by 
default. For array and matrix objects, you can change the MARGIN argument to a 
different value (eg. 2 for columns, etc.).

See ?unique for more information, notably the Details and Value sections.

Marc

On Dec 27, 2012, at 2:48 PM, Emmanuel Levy <emmanuel.l...@gmail.com> wrote:

> I did not know that unique worked on entire rows!
> 
> That is great, thank you very much!
> 
> Emmanuel
> 
> 
> On 27 December 2012 22:39, Marc Schwartz <marc_schwa...@me.com> wrote:
>> unique(t(apply(cbind(v1, v2), 1, sort)))

______________________________________________
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