insert_col: Insert a column into a data frame in a specified position

Description Usage Arguments Author(s)

View source: R/FUNctions.R

Description

Insert a column into a data frame in a specified position

Usage

1
2
insert_col(df, new_col, col_name = "new_col", numeric_index = TRUE,
  insert_index, insert_name, insert_left = TRUE)

Arguments

df

a data frame

new_col

a vector of same length of df to be added to df

col_name

name of the new column

numeric_index

should the new column be inserted by index (TRUE) or name (FALSE)

insert_index

position for new column to be inserted

insert_name

if numeric_index is FALSE, the column name the new column will be inserted adjacent to

insert_left

if numeric_index is FALSE, will the column be inserted to left of insert_name (TRUE), or to the right (FALSE)

Author(s)

Philip Goddard


philipmgoddard/FUNctions documentation built on May 25, 2019, 5:03 a.m.