add_name_to_tests: add_name_to_tests

View source: R/add_name_to_tests.R

add_name_to_testsR Documentation

add_name_to_tests

Description

Helper-function to add a field to a list or data.frame

Usage

add_name_to_tests(x, name, ...)

## S3 method for class 'list'
add_name_to_tests(x, name, ...)

## S3 method for class 'data.frame'
add_name_to_tests(
  x,
  name,
  colname_for_variable = atable_options("colname_for_variable"),
  ...
)

Arguments

x

an object

name

a value

...

passed to methods

colname_for_variable

a character length 1. Default is defined in atable_options

Details

Not intended to be called by the user.

checks if the new field already exists

Value

x now with new field colname_for_variable

Methods (by class)

  • add_name_to_tests(list): apply add_name_to_statistics to all field of the list

  • add_name_to_tests(data.frame): add field colname_for_variable to the data.frame. chekc for a name clash as this field as there are many user-defined fields


atable documentation built on Sept. 17, 2023, 5:06 p.m.