addCol: Adds a new column to data frame

View source: R/watanabe-df-manipulation.R

addColR Documentation

Adds a new column to data frame

Description

Adds a column to a dataframe. New column will be the last column in the data frame. Note, this should not be used to add columns from another data frame.

Usage

addCol(df, colData, colName = NULL, overwrite = FALSE)

Arguments

df

A data frame

colData

Vector. Must have same number of elements as the rows in df containing the data for the new column.

colName

Character vector. Name for the new column. If NULL, make.names() will be used to give the column a name.

overwrite

Boolean. Overwrite any existing data in the column named. Ignored if colName is not specified.

Value

The data frame with a new column added.


awatanabe/appr documentation built on Sept. 26, 2022, 8:04 a.m.