'Can´t generate a new dataframe using: as.data.frame

im trying to do a NMDS Analysis, i obtained the first graphic but i want to put I want to export my nmds object so that I can plot the figure in a nicer way using ggplot2. I have issues when i try to export the data to a new data frame using - data.scores -

install.packages("vegan")
library(vegan)
setwd("D:/Users/jpobl/")
pc = read.csv("log10ambientales.csv", header= TRUE)


com = pc[,7:ncol(pc)]
m_com = as.matrix(com)

set.seed(123)
nmds = metaMDS(m_com, distance = "bray")
nmds

plot(nmds)

#extract NMDS scores (x and y coordinates)
data.scores = as.data.frame(scores(nmds))

i got the error: Error in x$species[, choices, drop = FALSE] : incorrect number of dimensions

but as what i can see the dimensions and rows are ok



Sources

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

Source: Stack Overflow

Solution Source