How to remove duplicated sets from a list and get the first element in R?
<p>I have a list of vectors where each vector contains different numbers of numeric strings, e.g.</p>

<pre><code>A &lt;- list(c(2,3,1,5),c(4,3,1),c(1,4,3),c(3,4,2,1))
</code></pre>

<p>I would like to remove duplicated vectors, such that the result would be</p>

<pre><code>[[1]]
[1] 1 2 3 5

[[2]]
[1] 1 3 4

[[3]]
[1] 1 2 3 4
</code></pre>

<p>I am doing that by <code>unique(lapply(A, function(x) sort(unlist(x))))</code>, but I need to save the first element of each unique vector not sorted, that is:</p>

<pre><code>[[1]]
[1] 2

[[2]]
[1] 4

[[3]]
[1] 3
</code></pre>

<p>Could anyone help me please?</p>