matrix_expand: Expand a matrix, filling-down rows as needed

View source: R/matrix_expand.R

matrix_expandR Documentation

Expand a matrix, filling-down rows as needed

Description

Given a matrix m and a vector v of new row IDs, returns a new matrix with length(v) rows, and fills the empty rows with data from the nearest preceding row containing data.

Usage

matrix_expand(the.matrix, new.rows)

Arguments

the.matrix

A numeric matrix.

new.rows

A character vector of row names, of which a subset whould be the row names of the.matrix.

Value

A numeric matrix.


bocinsky/PaleoCAR documentation built on Feb. 23, 2023, 12:14 p.m.