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

Description Usage Arguments Value Examples

View source: R/AG_insert.R

Description

Calculate a new variable and insert it in a data frame

Usage

1
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

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

AGread documentation built on Feb. 26, 2020, 5:12 p.m.