Rfast (version 1.7.3)

Sort a vector coresponding to another : Sort

Description

Sort a vector coresponding to another.

Usage

sort_cor_vectors(x,y) sort_index(x, descending = FALSE)

Arguments

x
A numeric vector.
y
A numeric vector to help sorting the x.
descending
A logical value for choosing asceding or descending order.

Value

Returns the first argument but sorted acording to the second vector.

Details

This function implements the R's "sort" function using the C++'s function sort.

See Also

sort_mat, sort_unique

Examples

Run this code
y <- rnorm(100)
x <- rnorm(100)
b <- sort_cor_vectors(x,y)
b <- sort_index(x)

Run the code above in your browser using DataLab