This function sets an empty "label" attribute for a vector if it does not already have one.
Arguments
- x
A vector to be checked and potentially assigned an empty "label" attribute.
Value
The vector with an empty "label" attribute if it did not already have one.
Examples
if (FALSE) { # \dontrun{
# Example usage:
vec <- c("A", "B", "C")
vec <- set_empty_label(vec)
print(attr(vec, "label")) # Returns ""
} # }