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

insertRow

Insert Row into a Matrix


Description

Insert a new row into a matrix.

Usage

insertRow( m, r, v = NA, rName = "" )

Arguments

m

matrix.

r

row number where the new row should be inserted.

v

optional values for the new row.

rName

optional character string: the name of the new row.

Value

a matrix with one more row than the provided matrix m.

Author(s)

Arne Henningsen

See Also

Examples

m <- matrix( 1:4, 2 )
   insertRow( m, 2, 5:6 )

miscTools

Miscellaneous Tools and Utilities

v0.6-26
GPL (>= 2)
Authors
Arne Henningsen, Ott Toomet
Initial release
2019-12-08

We don't support your browser anymore

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