'Figure legend error: 'legend' is of length 0 - NMDS plot

I have constructed NMDS plots with data grouped by two variables (Dungfauna and Heating), however when I try to add a figure legend I get the error: 'legend' is of length 0.

There is another stackoverflow exchange discussing this (Why do the error occurs adding legend to plot?), but the solution does not work for me. Any help would be greatly appreciated.

My code:

dung.families.mds <- metaMDS(dung.families, distance = "bray", autotransform = FALSE, k = 3,
                             maxit = 999, 
                             trymax = 250,
                             wascores = TRUE)

ordiplot(dung.families.mds, type = "n", main = "Dung Fauna Ellipses, colour= DF, shapes=Heating")
orditorp(dung.families.mds, display = "sites", labels = F, pch = c(16, 17, 8) [as.numeric(group.variables$Heating)], 
         col = c("#696969", "#E69F00") [as.numeric(group.variables$Dungfauna)], cex = 1.9) 
ordiellipse(dung.families.mds, group.variables$Dungfauna, display="sites", 
            kind = "se", conf=0.95, label=F, 
            lwd=2, col=c("#696969", "#E69F00")) ```


Solution 1:[1]

.NET 6 is supported with Visual Studio 2022 and Visual Studio 2022 for Mac. It is not supported with Visual Studio 2019, Visual Studio for Mac 8, or MSBuild 16. If you want to use .NET 6, you will need to upgrade to Visual Studio 2022 (which is also now 64-bit). .NET 6 is supported with the Visual Studio Code C# extension.

This is from the Dev blog here https://devblogs.microsoft.com/dotnet/announcing-net-6/

Also there is a thread here - Visual Studio 2019 Not Showing .NET 6 Framework.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AchoVasilev