Coloring labels using scatterplot3d in R
I am trying to visualize data using R and scatterplot3d.
I have loaded data and used:
colors - c("#999999", "#E69F00", "#56B4E9" )
scatterplot3d(output$X2,output$X6 , output$X7 , color=colors, pch="X9")
X9 is label column in my dataset. it contains 3 categories : A , B , C.
By documentation:
color : colors of points in the plot, optional if x is an appropriate structure. Will be ignored if highlight.3d = TRUE.
pch: plotting "character", i.e. symbol to use.
Yet I still get this error
Error in scatterplot3d(output\$X2, output\$X6, output\$X7, color = colors, : length(color) must be equal length(x) or 1
I assumed I had to put color for every collumn in dataset, but creating such array where:
length( colors ) = length( num of columns )
yields the same error.
What is the right way to add colors?
Topic visualization r
Category Data Science