Hi I want to use order() to get the order of a vector.
But I would need a different behavior when ties occur: similar to the parameter ties.method = "random" in the rank() function, I would need to randomise the ties. Is this possible? Example: x <- rep(1:10, 2) order(x) [1] 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20 order(x) [1] 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20 ## I would need different "order" for the ties, as below in rank() example: rank(x, ties.method="random") [1] 1 4 6 7 10 12 13 15 18 19 2 3 5 8 9 11 14 16 17 20 > rank(x, ties.method="random") [1] 2 4 5 7 9 12 14 15 18 19 1 3 6 8 10 11 13 16 17 20 Thanks Rainer -- Rainer M. Krug, Centre of Excellence for Invasion Biology, Stellenbosch University, South Africa ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.