I'm not really sure what is happening considering it works on my computer at work, but doesn't transfer over when I'm on my laptop at home :/. For background, I am working with microbial community data using unifrac distances and trying to see how my different sample types cluster together.
Anywho, first I create a square distance matrix using my unifrac data file and my meta data.
generate.square.dist.matrix(unifrac,metadata,1)
unifrac.matrix.all = dist.matrix1
unifrac.dist.all = square.dist.matrix
Then run my NMDS
nmds.all = metaMDS(unifrac.dist.all, k = 4, trymax = 500, distance = "bray")
but when I attempt to extract my scores...
nmds.all.scores = as.data.frame(scores(nmds.all))
I receive the following error: "Error in x$species[, choices, drop = FALSE] : incorrect number of dimensions".
library()
commands. I cannot find any source for the functiongenerate.square.dist.matrix()
and your other commands seem to involve assignment using undefined objects, dist.matrix1 and square.dist.matrix.