Quick reminder on duplicate

> k <- c(1,1,3,5,7,7,10) 

> data.frame(k, duplicated(k), duplicated(k, fromLast=T)) 

 k  duplicated(k)  duplicated(k,fromLast=T) 
 1  FALSE          TRUE 
 1  TRUE           FALSE 
 3  FALSE          FALSE 
 5  FALSE          FALSE 
 7  FALSE          TRUE 
 7  TRUE           FALSE 
 10 FALSE          FALSE 

> unique(k) [1] 1 3 5 7 10
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s