View source: R/sortByNRepeated.R
sortByNRepeated | R Documentation |
The aim of this function is to count the number of occurances of words when comaring separate vectors (x
, y
and z
) or from a list (given as x
)
and to give an output sorted by their frequency.
The output lists the various values/words by their frequency, the names of the resulting list-elements indicate number of times the values/words were found repeated.
sortByNRepeated(
x,
y = NULL,
z = NULL,
filterIntraRep = TRUE,
silent = TRUE,
debug = FALSE,
callFrom = NULL
)
x |
(list, character or integer) main input, if list, arguments |
y |
(character or integer) supplemental vector to comare with |
z |
(character or integer) supplemental vector to comare with |
filterIntraRep |
(logical) allow making vectors |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
In order to compare the frquency of values/words between separate vectors or vectors within a list, it is necessary that these have been made unique before calling this function or using filterIntraRep=TRUE
.
In case the input is given as list (in x
), there is no restriction to the number of vectors to be compared.
With very long lists, however, the computational effort incerases (like it does when using table
)
This function returns a list sorted by number of occurances. The names of the list indicate the number of repeats.
table
, replicateStructure
sortByNRepeated(x=LETTERS[1:11], y=LETTERS[3:13], z=LETTERS[6:12])
sortByNRepeated(x=LETTERS[1:11], y=LETTERS[c(3:13,5:4)], z=LETTERS[6:12])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.