I have 4 columns of data in R that looks like this
x y z group
the group
columns has categorical values, so it is a discrete set of values, whereas the other three columns are continuous.
I want to make a 3d plot in R with x
, y
, and z
, and where the color of the dot is given by "group". I also want to have a legend to this plot. How can I do this? I don't have a particular preference on the actual colors. I suppose rainbow(length(unique(group))
should do fine.