Check the length of the color vector. It must match the number of rows of the dataset.
checkDim(x, data)
x
The color vector
data
The dataset