visuals<-,Asset-method {Allspice} R Documentation

## Visual attributes

### Description

Attach text and color attributes to categories.

### Usage

visuals(obj) <- value


### Arguments

 obj An object of the class Asset. value A character vector or a data frame, see details.

### Details

If the input value is a character vector, the elements are stored as the category text and names of the elements are stored as category names.

If the input value is a data frame, the column 'LABEL' is used as the text and the row names as the names of the categories. Additional columns may include 'COLOR', 'COLOR.dark' and 'COLOR.light' that must contain strings of color names or hexadecimal codes as produced by rgb(). In absence of color data, the function assigns automatic colors.

### Examples

# Create a new asset and set nomenclature.
a <- asset()

# Set category labels with automatic colors.
labels <- paste("Category", 1:8)
names(labels) <- paste0("cat", 1:8)
visuals(a) <- labels
print(a@categories)