chameleon contains a set of functions for automatically assigning colors to multi-dimensional data. The colors are distinct (as much as possible) and also reflect the internal structure of the data (as much as possible).
To install it, use:
In general, if you have a matrix whose rows represent some elements/observations and whose columns represent some variables/measurements, then use
chameleon::data_colors to obtain a color for each row. You can pass this function the optional
groups parameter which assigns a group to each row, to obtain a color for each group instead of a color for each row.