AG_insert: Calculate a new variable and insert it in a data frame

View source: R/AG_insert.R

AG_insertR Documentation

Calculate a new variable and insert it in a data frame

Description

Calculate a new variable and insert it in a data frame

Usage

AG_insert(AG, var_name, after_var, value)

Arguments

AG

The original data frame

var_name

character. The new variable name

after_var

character. The existing variable name, after which to insert the new variable

value

The value to assign the new variable

Value

A data frame with the new variable added at the specified index

Examples


data("imu_to_collapse")
test <- imu_to_collapse[ ,1:3]
head(AG_insert(
  test, "new_variable",
  "Timestamp", "A new variable"
))

AGread documentation built on Sept. 13, 2022, 5:06 p.m.