Hallo again dear forum,
I am not the best of friends with these 3D plots, and I struggle with simple formatting stuff. Like now, where I can't color my plots from a variable.
with(samples3d, {
s3d <- scatter3D(MDS2, MDS3, MDS1, pch = ifelse(meta$op.closed=="cl",22,21), type = "h",colvar = pcolor, lty.hplot=2, scale.y=0.75)
} )
It gives me this error:
Error in clim[2] - clim[1] : non-numeric argument to binary operator
I can read from the documentation that:
"colvar :The variable used for coloring. ... if specified, it should be a vector of equal length as (x, y, z)."
So in my naïve approach I checked
colvec <- as.vector(samples3d$pcolor)
MDS1vec <- as.vector(samples3d$MDS1)
length(MDS1vec)
43
length(colvec)
43
- and they are the same length, so what is wrong here?
Best, Mathilde