1,往矩阵中插入一行或者一列
install.package(miscTools)
library(miscTools)
#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.
#Examples
m <- matrix( 1:4, 2 )
insertRow( m, 2, 5:6 )
2,