geom_mark_hull include empty spaces with no points

103 Views Asked by At

I am plotting biplots of NMDS and using ggforce::geom_marK_hull to create hulls around points representing fish communities from two sites, faceted by year and season (wet and dry): Biplot

I found that some of the hulls are including empty spaces without any points (e.g. Upstream group in wet season 2018 and Upstream group in dry season 2020). I have tried to adjust the expand argument but it seems the problem persists.

Any idea what the reason might be? I would appreciate any comments or help! Thanks in advance!

Raw data files used are fish.spp and fish.env. Codes are:

library(vegan)
library(ggplot2)
library(ggforce)
library(concaveman)

fish.nmds.k3 <- metaMDS(fish.spp, distance = "bray", k = 3)
fish.nmds.k3.sites <- as.data.frame(fish.nmds.k3$points)
fish.nmds.k3.sp <- as.data.frame(fish.nmds.k3$species)

(ggplot(fish.nmds.k3.sites, aes(MDS1, MDS2))+ 
        ylim(-3, 3) + xlim (-3, 3) +
        geom_mark_hull(aes(fill = fish.env$Site), expand = unit(3, "mm")) +
        geom_point() +    
        labs(title = "NMDS Plot of Freshwater Fish Community") +
        theme_bw() +
        theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 10),
             panel.grid = element_blank()) +
        facet_grid(rows = vars(fish.env$Year), cols = vars(fish.env$Season))
)
0

There are 0 best solutions below