Description Usage Arguments Details Value Note References See Also Examples
Performs a multidimensional sorting of a data.frame
.
One can choose between various approaches for the sorting, see the Details.
1 | multiSorting(data, method = "identity", control = list())
|
data |
[ |
method |
[ |
control |
[ |
The following methods for sorting are supported:
"identity"
order in the data set (i.e. the function does no further sorting).
"random"
a random order.
"norm"
ordering via a vector norm.
"median"
ordering via the median value per data point vector.
"dimSort"
sorting the data one-dimensional. Ties are broken by the next dimension and so on.
"weightedSum"
ordering the data via the value of a weighted sum per data point vector.
"projection"
projects the points of the data set orthogonal on a line.
"nonDomSort"
Nondominated Sorting. Ties can be broken via one of the other methods.
"convhull"
Computing repeatedly convex hulls for ordering the data.
"halfspace"
ordering according to the (approximate) values of Tukey's halfspace depth.
"clust"
Take the order gotten from a hierarchical clustering by hclust
"nn"
Nearest-Neighbor-Heuristic. Tries to find a shortest path trough the data by always taking the next nearest not-so-far-chosen point.
"shp"
Computes the Shortest Hamiltonian Path through the data.
The control
argument is a list that can supply any of the following components:
degree
[numeric(1)
]For method "norm"
:
Non-negative (possibly infinity) parameter of a vector-norm. Default: 2
.
order
[integer
]For method "dimSort"
:
Vector of dimension indices which determine the order of sorting. Default: 1:ncol(data)
.
weights
[numeric
]For method "weightedSum"
:
Non-negative vector of length ncol(data)
which give the weight for each dimension.
Default: rep(1, ncol(data))
.
vec.pos
[numeric
]For method "projection"
:
Vector of length ncol(data)
which gives the position vector of the line to project on.
Default: rep(0, ncol(data))
.
vec.dir
[numeric
]For method "projection"
:
Vector of length ncol(data)
which gives the direction vector of the line to project on.
Default: rep(1, ncol(data))
.
tie.breaking
[character(1)
]For method "nonDomSort"
:
A character string determining one of the other methods for tie-breaking of the domination ranks.
Default: "identity"
. Note, that if the chosen method has control arguments itsself,
they can/should be also given via control
.
clust.method
[character(1)
]For method "clust"
:
The method
-argument of hclust
. Default: "complete"
.
dist.method
[character(1)
]For method "clust"
, "nn"
and "shp"
:
The method
-argument of dist
. Default: "euclidean"
.
p
[numeric(1)
]For method "clust"
, "nn"
and "shp"
:
The p
-argument of dist
. Default: 2
.
path
[character(1)
]For method "convhull"
, "halfspace"
and "shp"
:
Path to the executable code of the Concorde solver. Default: The working directory.
prec
[numeric(1)
]For method "shp"
:
The precision, i.e. the number of decimal places using for the distances between two points.
Default: 6
.
Named list with the entries:
sortedData
[data.frame
]The sorted data.
inds
[integer
]The sorted indices of the rows of the input data.
The code of the Concorde TSP package is not included in this package and has to be obtained separately from the Concorde web site (see references). Either download the precompiled executables and place them in a suitable directory and make them executable, or you can get the source code and compile it on your own. TSP needs to know where the executables are.
Horn M. Sign depth for parameter tests in multiple regression. TU Dortmund University; 2021.
Barber, C. B., Dobkin, D. P., and Huhdanpaa, H. (1996). “The Quickhull Algorithm for Convex Hulls”. In: ACM Trans. Math. Softw. 22.4, pp. 469–483.
Tukey, J. W. (1975). “Mathematics and the picturing of data”. In: Proceedings of the International Congress of Mathematicians (Vancouver, BC, 1974), Volume 2. Montreal, Quebec, Canada: Canadian Mathematical Congress, pp. 523–531.
Deb, K., Agrawal, S., Pratap, A., and Meyarivan, T. (2000). “A Fast Elitist Non- dominated Sorting Genetic Algorithm for Multi-objective Optimization: NSGA-II”. In: Parallel Problem Solving from Nature PPSN VI. Berlin, Heidelberg: Springer Berlin Heidelberg, pp. 849–858.
Rockafellar, R. T. (1970). Convex analysis. Vol. 28. Princeton mathematical series. Princton University Press.
Concorde home page, http://www.tsp.gatech.edu/concorde/
Concorde download page, http://www.tsp.gatech.edu/concorde/downloads/downloads.htm
David Appletgate, Robert Bixby, Vasek Chvatal, William Cook (2001): TSP cuts which do not conform to the template paradigm, Computational Combinatorial Optimization, M. Junger and D. Naddef (editors), Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 | multiSorting(iris[, 1:4], method = "identity")
multiSorting(iris[, 1:4], method = "random")
multiSorting(iris[, 1:4], method = "norm")
multiSorting(iris[, 1:4], method = "median")
multiSorting(iris[, 1:4], method = "dimSort")
multiSorting(iris[, 1:4], method = "weightedSum")
multiSorting(iris[, 1:4], method = "projection")
multiSorting(iris[, 1:4], method = "nonDomSort")
multiSorting(iris[, 1:4], method = "convhull")
multiSorting(iris[, 1:4], method = "halfspace")
multiSorting(iris[, 1:4], method = "clust")
multiSorting(iris[, 1:4], method = "nn")
## Not run: multiSorting(iris[, 1:4], method = "shp")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.