insertRowAndKeepAttr: Insert a row into a matrix

Description Usage Arguments Value Author(s) Examples

Description

Inserts a row and keeps the attributes copyAllNewAttributes

Usage

1
insertRowAndKeepAttr(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

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

Author(s)

Max Gordon, Arne Henningsen

Examples

1
2
3
4
test <- matrix(1:4, ncol=2)
attr(test, 'wow') <- 1000
test <- insertRowAndKeepAttr(test, 2)
print(attr(test, 'wow'))


Search within the Gmisc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.