Skip to content
Prev 313049 / 398503 Next

duplicated() with long vectors

Hi Sarah,

Thanks a lot for your explanation. I was mistakenly under the
impression that duplicated() only looked at immediately preceding
element, not all preceding elements.

What I was trying to do was get a vector saying, for each item,
whether that item is the same as the preceding item. Now that I think
of it, I could do this easily by copying the vector, shifting it over
one (by removing the first element and adding something to the end),
and then just compare the elements of the two vectors directly.

Best,
Steve
On Wed, Dec 5, 2012 at 3:08 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote: