Skip to content
Prev 243924 / 398506 Next

Question about #1 zoo-faq

On 04/12/2010 5:40 AM, Alexander Salim wrote:
Remember that duplicated() doesn't return TRUE for all copies, only the 
second (and later ones).  For example,

duplicated(c(1,1,2,2,1))

returns

[1] FALSE  TRUE FALSE  TRUE  TRUE

I believe the %in% operator works on zoo objects, so you can see all 
copies using

x <- with(dataSet1, Time %in% Time[duplicated(Time)])
dataSet1[x,]

Duncan Murdoch