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

insertCol

Insert Column into a Matrix


Description

Insert a new column into a matrix.

Usage

insertCol( m, c, v = NA, cName = "" )

Arguments

m

matrix.

c

column number where the new column should be inserted.

v

optional values of the new column.

cName

optional character string: the name of the new column.

Value

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

Author(s)

Arne Henningsen

See Also

Examples

m <- matrix( 1:4, 2 )
   insertCol( 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.