Add an attribute to an object where the attribute is added as a name to the names of the object.
setAttributeColumn(
object,
attr_name,
col_or_value,
col_name,
default_value,
stop_if_default,
warn_if_default,
message_if_default
)
The object to set the attribute column on.
The attribute name to set
If this exists as a column in the data, it is
used as the col_name
. If not, this becomes the
default_value
.
The name of the column within the dataset to use (if
missing, uses attr_name
)
The value to fill in the column if the column
does not exist (the column is filled with NA
if it does not
exist and no value is provided).
A character
string to provide as an error, a warning, or a messagemessage to
the user if the default_value
is used. They are tested in
order (if stop, the code stops; if warning, the message is ignored;
and message last).
The object with the attribute column added to the data.