I am trying to make a biplot in R using the vegan package:
shared_tbl <-read_tsv("data/andok.shared")
my data is like this table:
Group | Blastocatellales | Frankiales | Cyanobacteriales |
---|---|---|---|
sample1 | 319 | 2563 | 546 |
sample2 | 4114 | 657 | 986 |
sample3 | 1463 | 123 | 85 |
sample4 | 158 | 367 | 631 |
shared_df <- shared_tbl%>%
column_to_rownames("Group")
#make a distance matrix
andok_dist <- avgdist(shared_df, sample = 1156)
#nmds ordination
set.seed(1996020)
andok_nmds <- metaMDS(andok_dist)
scores(andok_nmds)
and then I got the error: Error in x$species[, choices, drop = FALSE] : incorrect number of dimensions
A solution has reached in metaMDS after setting the seed.
I made my steps according to Pat Schloss https://www.youtube.com/watch?v=_EjNR6YdnGM&t=45s%5C half years ago, when the whole code ran without any errors.
This error may occur in vegan 2.6-2. It was fixed in the latest release version 2.6-4. Please upgrade your vegan. If you cannot or will not upgrade vegan, explicitly skip species scores (that you do not have when input data are dissimilarities which have no information on species):
scores(andok_mds, display="sites")
The problems was introduced when the scores
function gained option of directly producing "tidy" scores for ggplot2 graphics.