Как добавить новые баллы в ординацию NMDS? - PullRequest
0 голосов
/ 09 июля 2020

Я хотел бы увидеть, как будет упорядочен один участок растительности, если я уберу один или n видов с этого участка. Я использовал функцию metaMDS из пакета vegan, и я хотел бы добавить новый график, такой как функция predict.cca после cca.

Я попытался просто объединить два моих data.frame (исходный и модифицированный) перед выполнением metaMDS, но ординация сильно перемещается ..

Кто-нибудь знает, как это сделать?

Вот воспроизводимый пример моего проблема:

library(vegan)
data(dune)
#the original NMDS :
NMDS <- metaMDS(dune)
plot(NMDS$points)
text(NMDS$points,labels = 1:nrow(dune))

#The suppression of one random occurence on the first plot (for instance) :
occurence_1 <- which(dune[1,]!=0) #the col number where species occur in plot 1
dune_1_mod <- dune[1,]
dune_1_mod[,sample(occurence_1,size = 1)] <- 0 

#Then I would like to have a function "predict.MDS" (that I unfortunately don't know) where I could do that :
dune_1_mod_coordinates <- predict.MDS(NMDS, newdata = dune_1_mod)

#which would provide me the coordinates of my modified plot in the previous NMDS ordination and allow me to plot it on the same plot :
points(x = dune_1_mod_coordinates$points[,1], y = dune_1_mod_coordinates$points[,2])

#I tried to just add some new modified plot, run the MDS on the whole dataset and plot it, but it seems that the ordination is deeply modified and driven by the characteristics of the new modified plots
#see here :

plot(NMDS$points)
text(NMDS$points,labels = 1:nrow(dune))

occurence_1 <- which(dune[1,]!=0)

dune2 <- dune
for(i in 1:length(occurence_1))
{
  dune2[i+nrow(dune),] <- dune2[1,] 
  dune2[i+nrow(dune),occurence_1[i]] <- 0 
}
NMDS2 <- metaMDS(dune2)
plot(NMDS2$points,col=c(rep(1,nrow(dune)),rep(2,length(occurence_1))))
text(NMDS2$points,labels = c(1:nrow(dune),rep(NA,length(occurence_1))))
...