Learn R Programming

scanstatistics (version 1.0.1)

prioritize_cols: Order row contents by priority for each timepoint.

Description

Given a matrix of priority function values, return a matrix in which each row gives the column indices of the corresponding row in the priority matrix, when that row has been sorted from highest to lowest priority value.

Usage

prioritize_cols(priority_matrix)

Arguments

priority_matrix

A numeric or integer matrix. Rows represent time (ordered from most recent to most distant), columns represent e.g. locations or data streams (numbered from 1 and up). The element in row \(i\) and column \(j\) holds the priority of the \(j\)th location/data stream for times \(1,\ldots,i\).

Value

A matrix of the same size as the input. On each row, column indices are given in order of priority.