newColName: generate a good column name

Description Usage Arguments Value

View source: R/explode.R

Description

1
2
3
Given column names of one or two two dimensional objects,
each with just one single column,  and a function and its arguments,
generate a new column name and return the original 'one column' two dimensional object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
newColName(
  x = NULL,
  Fun = NULL,
  isCharFun = NULL,
  x1 = NULL,
  x2 = NULL,
  FlagsCombo = NULL,
  AltName = NULL,
  asIsAltName = NULL,
  Prefix = NULL,
  FixedSep = NULL
)

Arguments

x

object with the old column names

Fun

literally written function or the function name inside a string. if mode(Fun) == "function", then the returned (xts and) xts root column name is "Anon". Alternately instead of "Anon", the use may (always) explicity provide the return (xts and) xts root column name.

isCharFun

hint as to Fun being a function or the function name inside of a string

x1

object providing part of the new column name

x2

object providing (yet another) part of the the new column name

FlagsCombo

list with named elements and their values to (eventually) become part of the new column name

AltName

column new root name. Default is NULL. The input value is a string. Unless a string is provided then the root name will not be replaced.

asIsAltName

Default is NULL(F). NULL is interpreted as F. This NULL(F) means do not attempt to simplify the AltName. For example, if the user passed "TTR::SMA" and asIsAltName == T, then "TTR::SMA" would directly tried to become part of the column name (and "::" would cause an error so this would not work.). If the user passed "TTR::SMA" and asIsAltName == NULL(F), then "SMA" would be directly tried to directly become part of the column name.

Prefix

place the new addition to the column name at the front instead of the end. Default is NULL. Internally the default is FALSE.

FixedSep

replacement for "[.]|::" that was found in the function name

Value

object with the new column names


AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.