filtSizeUniq {wrMisc} | R Documentation |
Filter for unique elements
Description
This function aims to identify and remove duplicated elements in a list and maintain the list-structure in the output.
filtSizeUniq
filters 'lst' (list of character-vectors or character-vector) for elements being unique (to 'ref' or if NULL to all 'lst') and of character length.
In addition, the min- and max- character length may be filtered, too. Eg, in proteomics this helps removing peptide sequences which would not be measured/detected any way.
Usage
filtSizeUniq(
lst,
ref = NULL,
minSize = 6,
maxSize = 36,
filtUnique = TRUE,
byProt = TRUE,
inclEmpty = TRUE,
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
Arguments
lst |
list of character-vectors or character-vector |
ref |
(character) optional alternative 'reference', if not |
minSize |
(integer) minimum number of characters, if |
maxSize |
(integer) maximum number of characters |
filtUnique |
(logical) if |
byProt |
(logical) if |
inclEmpty |
(logical) optional including empty list-elements when all elements have been filtered away - if 'lst' was named list |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
Value
list of filtered input
See Also
correctToUnique
, unique
, duplicated
Examples
filtSizeUniq(list(A="a",B=c("b","bb","c"),D=c("dd","d","ddd","c")),filtUn=TRUE,minSi=NULL)
# input: c and dd are repeated
filtSizeUniq(list(A="a",B=c("b","bb","c"),D=c("dd","d","ddd","c")),ref=c(letters[c(1:26,1:3)],
"dd","dd","bb","ddd"),filtUn=TRUE,minSi=NULL) # a,b,c,dd repeated