Learn R Programming

doseSens (version 1.0.0)

apply_permutation_to_matrix: A function that returns a permuted vector according to a matrix and permutation vector.

Description

A function that returns a permuted vector according to a matrix and permutation vector.

Usage

apply_permutation_to_matrix(M, p)

Value

a length n vector with ith entry corresponding to the i, p_i entry in M

Arguments

M

a square matrix of dimension n

p

a permuted version of the vector from 1:n

Examples

Run this code
mat <- matrix(1:9, nrow = 3, ncol = 3)
perm <- c(2, 1, 3)
permuted <- apply_permutation_to_matrix(M = mat, p = perm)

Run the code above in your browser using DataLab