mmixedOrder | R Documentation |
order alphanumeric values from a list
mmixedOrder(
...,
decreasing = FALSE,
blanksFirst = TRUE,
na.last = NAlast,
keepNegative = FALSE,
keepInfinite = FALSE,
keepDecimal = FALSE,
ignore.case = TRUE,
useCaseTiebreak = TRUE,
sortByName = FALSE,
NAlast = TRUE,
honorFactor = TRUE,
verbose = FALSE,
matrixAsDF = TRUE
)
... |
arguments treated as a |
blanksFirst , na.last , keepNegative , keepInfinite , keepDecimal , ignore.case , useCaseTiebreak , sortByName |
arguments passed to |
verbose |
|
matrixAsDF |
|
This function is a minor extension to mixedOrder()
,
"multiple mixedOrder()
",
which accepts list
input, similar to how base::order()
operates.
This function is mainly useful when sorting something like a
data.frame
, where ties in column 1 should be maintained then
broken by non-equal values in column 2, and so on.
This function essentially converts any non-numeric column
to a factor, whose levels are sorted using mixedOrder()
.
That factor is converted to numeric value, multiplied by -1
when decreasing=TRUE
. Finally the list of numeric vectors
is passed to base::order()
.
In fact, mixedSortDF()
calls this mmixedOrder()
function,
in order to sort a data.frame
properly by column.
See mixedOrder()
and mixedSort()
for a better
description of how the sort order logic operates.
integer vector of row orders
Other jam sort functions:
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
Other jam string functions:
asSize()
,
breaksByVector()
,
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
fillBlanks()
,
formatInt()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
,
nameVectorN()
,
nameVector()
,
padInteger()
,
padString()
,
pasteByRowOrdered()
,
pasteByRow()
,
sizeAsNum()
,
tcount()
,
ucfirst()
,
uniques()
Other jam string functions:
asSize()
,
breaksByVector()
,
cPasteSU()
,
cPasteS()
,
cPasteUnique()
,
cPasteU()
,
cPaste()
,
fillBlanks()
,
formatInt()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
mixedOrder()
,
mixedSortDF()
,
mixedSorts()
,
mixedSort()
,
nameVectorN()
,
nameVector()
,
padInteger()
,
padString()
,
pasteByRowOrdered()
,
pasteByRow()
,
sizeAsNum()
,
tcount()
,
ucfirst()
,
uniques()
# test factor level order
factor1 <- factor(c("Cnot9", "Cnot8", "Cnot10"))
sort(factor1)
mixedSort(factor1)
factor1[mixedOrder(factor1)]
factor1[mixedOrder(factor1, honorFactor=FALSE)]
factor1[mixedOrder(factor1, honorFactor=TRUE)]
factor1[mmixedOrder(list(factor1))]
factor1[mmixedOrder(list(factor1), honorFactor=FALSE)]
factor1[mmixedOrder(list(factor1), honorFactor=TRUE)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.