uniques | R Documentation |
Apply unique to each element of a list, usually a list of vectors
uniques(
x,
keepNames = TRUE,
incomparables = FALSE,
useBioc = TRUE,
useSimpleBioc = FALSE,
xclass = NULL,
...
)
x |
input list of vectors |
keepNames |
boolean indicating whether to keep the list element names in the returned results. |
incomparables |
see |
useBioc |
boolean indicating whether this function should try
to use |
This function will attempt to use S4Vectors::unique()
which is
substantially faster than any apply
family function, especially
for very long lists. However, when S4Vectors
is not installed,
it applies uniqueness to the unlist
ed vector of values, which is
also substantially faster than the apply
family functions for
long lists, but which may still be less efficient than the
C implementation provided by S4Vectors
.
list
with unique values in each list element.
Other jam string functions:
asSize()
,
breaksByVector()
,
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
fillBlanks()
,
formatInt()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
,
mmixedOrder()
,
nameVectorN()
,
nameVector()
,
padInteger()
,
padString()
,
pasteByRowOrdered()
,
pasteByRow()
,
sizeAsNum()
,
tcount()
,
ucfirst()
Other jam list functions:
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
heads()
,
jam_rapply()
,
list2df()
,
mergeAllXY()
,
mixedSorts()
,
rbindList()
,
relist_named()
,
rlengths()
,
sclass()
,
sdim()
,
unnestList()
L1 <- list(CA=nameVector(LETTERS[c(1:4,2,7,4,6)]),
B=letters[c(7:11,9,3)],
D=nameVector(LETTERS[4]));
L1;
uniques(L1);
if (1 == 1) {
if (suppressWarnings(suppressPackageStartupMessages(require(IRanges)))) {
printDebug("Bioc CompressedList:");
print(system.time(uniques(rep(L1, 10000), useBioc=TRUE)));
}
if (suppressWarnings(suppressPackageStartupMessages(require(S4Vectors)))) {
printDebug("Bioc SimpleList:");
print(system.time(uniques(rep(L1, 10000), useSimpleBioc=TRUE)));
}
printDebug("Simple list, keepNames=FALSE:");
print(system.time(uniques(rep(L1, 10000), useBioc=FALSE, keepNames=FALSE)));
printDebug("Simple list, keepNames=TRUE:");
print(system.time(uniques(rep(L1, 10000), useBioc=FALSE, keepNames=TRUE)));
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.