Learn R Programming

RMVL (version 1.1.0.1)

mvl_order_vectors: Return permutation sorting vector entries

Description

This function is similar to R order() function, but operates on MVL_OBJECTS.

Usage

mvl_order_vectors(
  L,
  indices = NULL,
  decreasing = FALSE,
  sort_function = ifelse(decreasing, 2, 1)
)

Value

sorted indices

Arguments

L

list of vector like MVL_OBJECTs

indices

list of indices into objects to sort. If absent or NULL it is assumed to be from 1 to length of the object.

decreasing

whether to sort in ascending or decreasing order. This parameter is provided for compatibility with order() function

sort_function

specifies desired sort order

See Also

mvl_hash_vectors, mvl_find_matches, mvl_group, mvl_find_matches, mvl_indexed_copy, mvl_merge

Examples

Run this code
if (FALSE) {
Mtmp<-mvl_open("tmp_a.mvl", append=TRUE, create=TRUE)
mvl_write_object(Mtmp, runif(100), "vec1")
Mtmp<-mvl_remap(Mtmp)
permutation1<-mvl_order_vectors(list(Mtmp["vec1", ref=TRUE]))
}

Run the code above in your browser using DataLab