insertColumn: Insert column in an object.

Description Usage Arguments Value

View source: R/util.R

Description

Insert column in an object.

Usage

1
insertColumn(x, col.index, col.name = NULL, data = NA)

Arguments

x

A data.frame or matrix.

col.index

Column index of inserted column.

col.name

Column name of inserted column. If a column name is specified, but the object has no existing column names, default names (e.g. 'COL05') will be assigned to the existing columns. If a column name is not specified, but the object has existing column names, the inserted column will be assigned a default column name.

data

Optional vector of data to insert in the new column. The length of this vector should be evenly divisible by the number of rows in the data frame.

Value

Input object with column inserted.


gact/shmootl documentation built on Nov. 11, 2021, 6:23 p.m.