NMDS plot code issue

Good day all, i am new to this forum and novice in using R, i am following a tutorial on tittled R code for ecological data analysis by Umer Zeeshan Ijaz, using his data i was abled to plot NMDS diagram, but with my data which i checked is almost similar with the data he used when i use the code:

#Make a new data frame, and put country, latrine, and depth information there, to be useful for coloring, and shape of points

NMDS=data.frame(x=sol$point[,1],y=sol$point[,2],Samples=as.factor(grouping_info[,1]),Latrine=as.factor(grouping_info[,2]),Depth=as.factor(grouping_info[,3]))

i got an error: Error in `[.data.frame`(grouping_info, , 2) : undefined columns selected

attached pictures (first two) are my data formats and his data (last two).

Need your help to fix this issue. Thank you




Tagged:

Best Answer

  • Gurpreet
    Answer ✓

    Hi @saubanzango ,

    Can you please confirm that you are using Refinitiv products or services?

    For generic programming questions, I would recommend that you raise this question on stackoverflow.com.