Amelia Preston
Amelia Preston

Reputation: 1

Error code of error in force of length of variables in plot3d

I am trying to create a plot to compare the community composition of 3 sites. I have the code but it keepsreturning the same error of Error in force || length(c(xlim, ylim, zlim)) : 'length = 30' in coercion to 'logical(1)'

my code is:

data3new$Mound <- as.factor(data3new$Mound)
summary(data3new)
colours <- c("lightblue", "purple", "hotpink")
data3new$colours <- colours[as.numeric(data3new$Mound)]

plot3d(beetle, springtail, mollusc, worms, larvae, woodlice, millipede, mite, earwig, fly, spider,      snails, hemiptera, centipede, type = "s", radius = 0.5, 
col = data3new$colours, add = TRUE)

I have also tried:

Mounds <- c("1", "2", "3")
species_names <- c("beetle", "mollusc", "worms", "larvae", "woodlice", "millipede", "mite", "earwig", "fly", "spider", "snails", "hemiptera", "centipede")
abundances <- matrix(data = round(runif(13*length(species_names), min = 0, max = 100)), nrow = 13, ncol = length(species_names))

Plot species composition in 3D space

plot3d(abundances[, 1], abundances[, 2], abundances[, 3], type = "s", radius = 0.1, col = "blue")
text3d(abundances[, 1], abundances[, 2], abundances[, 3], texts = Mounds, adj = c(-0.5, 0.5), col =     "black")

I get the axis but no points :(

I was expecting a plot of 3 shapes either overlapping or not. I was then going to carry out PCA analysis.

I had axis at one point but no points.

Upvotes: 0

Views: 16

Answers (0)

Related Questions