uniqueVec {makePMG}R Documentation

Find the unique elements of a vector or list and return those.

Description

The difference between this and unique is that the list is vectorized and the argument removeNA allows you to optionally remove NA's.

Usage

uniqueVec(oList, removeNA=FALSE)

Arguments

oList The list from which duplicates will be removed.
removeNA A boolean value, if TRUE then duplicates will be removed.

Details

Not much to say, unlist then use unique. NAs are replaced with the string NotMapped.

Value

A vector containing the unique elements in the input list.

Author(s)

E. Whalen and R. Gentleman

Examples

  xx<-list(a= 1:10, b=c(22,3,5))
  uniqueVec(xx) 

[Package Contents]