Search code examples
rggplot2statistics

Why is my NMDS plot arch/horse shoe shaped?


I have a dataset which contains monthly sampled zooplankton data. It is always for the same sampling site so not spatial, but over 10 years. I wanted to use an NMDS plot to see if the zooplankton community (during MArch, April and May) from 2014-2024 would be grouped into distinct communities using an NMDS but it comes out arch shaped. Can I solve this? The samples do not have extra environmental variables. I used the total abundance (m-3) of each sample.

set.seed(123)
nmds <- metaMDS(dist_matrix, k = 2, trymax = 100)

stress_value<-nmds$stress

nmds_scores <- as.data.frame(scores(nmds))
nmds_scores$month <- Total_Abundance_Spring_Mero$Month
nmds_scores$year <- Total_Abundance_Spring_Mero$Year

# Plot NMDS
ggplot(nmds_scores, aes(x = NMDS1, y = NMDS2, color = factor(year), shape = factor(month))) +
  geom_point(size = 3) +
  labs(title = "Total abundance (m-3) of Meroplankton in Spring", x = "NMDS1", y = "NMDS2", color = "Year", shape = "Month") +
  theme_classic()+
  annotate("text", x = Inf, y = Inf, label = paste("Stress =", round(stress_value, 4)), 
           hjust = 1.1, vjust = 1.1, size = 5, color = "red")

Arch Shaped NMDS plot, shapes represent the month and color the year:

enter image description here


Solution

  • It's a problem in the part of the code you didn't post, either your data or how you calculate the dist_matrix.

    If I run the following, I also get an arc.

    library(vegan)
    library(ggplot2)
    
    Total_Abundance_Spring_Mero <- data.frame(
      Month = sample(1:12, 100, replace = TRUE), 
      Year = sample(2010:2020, 100, replace = TRUE), 
      n1 = 1:100,
      n2 = 1:100)
    
    dist_matrix <- vegdist(Total_Abundance_Spring_Mero[, -c(1, 2)], method = "bray")
    
    nmds <- metaMDS(dist_matrix, k = 2, trymax = 100)
    
    stress_value<-nmds$stress
    
    nmds_scores <- as.data.frame(scores(nmds))
    nmds_scores$month <- Total_Abundance_Spring_Mero$Month
    nmds_scores$year <- Total_Abundance_Spring_Mero$Year
    
    # Plot NMDS
    ggplot(nmds_scores, aes(x = NMDS1, y = NMDS2, color = factor(year), shape = factor(month))) +
      geom_point(size = 3) +
      labs(title = "Total abundance (m-3) of Meroplankton in Spring", x = "NMDS1", y = "NMDS2", color = "Year", shape = "Month") +
      theme_classic()+
      annotate("text", x = Inf, y = Inf, label = paste("Stress =", round(stress_value, 4)), 
               hjust = 1.1, vjust = 1.1, size = 5, color = "red")