Get the value from a column in a data frame if the value is a column there, otherwise, the value should be a scalar or the length of the data.
getColumnValueOrNot(data, value, prefix = "X")
A list with elements named "data", "name" giving the
data
with a column named "name" with the value in that
column.
A data.frame or similar object
A character string giving the name of a column in the
data
, a scalar, or a vector the same length as the
data
The prefix to use if a column must be added (it will be used as the full column name if it is not already in the dataset or it will be prepended to the maximum column name if not.)