Generate a column name that does not already exist in a list of columns
Source:R/model_parameters_pipeline_utils.R
dot-get_unused_column.RdGenerates a unique column name by appending an integer to a prefix.
Arguments
- existing_columns
Existing character vector/list of columns. We want a column name that does not already exist among these column names.
- column_prefix
Character prefix for the column name
- column_suffix
If a column named column_prefix already exists then column_suffix is appended to column_prefix, replacing "#" with an integer, to try to find an unused column name. For example, if column_prefix = "output" and column_suffix = "_#", then "output" will be returned if such a column doesn't exist. If it does exist, then "output_2", "output_3", etc. will be tested until an unused column name is found.