Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reorder

Reorder a matrix vertically according to a vector of new positions


Description

Reorder a matrix vertically according to a vector of new positions.

Usage

reorder(mat, new.order)

Arguments

mat

Input matrix.

new.order

Vector of integer numbers with the new order of rows. The new order must contain as many elements as the matrix has rows and it must not contain NA values, duplicate entries, or gaps.

Details

This function takes a matrix and reorders its rows based on a vector of new positions.

Value

Reordered matrix.

Author(s)

Philip Leifeld

See Also


texreg

Conversion of R Regression Output to LaTeX or HTML Tables

v1.37.5
GPL-3
Authors
Philip Leifeld [aut, cre], Claudia Zucca [ctb]
Initial release
2020-06-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.