I am trying to plot some NMDS co-ordinates as x and y, and use a diversity measure (shannon)to plot as a contour but I keep getting the following error and I can't see why...
Error in if (empty(new)) return(data.frame()) :
missing value where TRUE/FALSE needed
My code is:
all_merge <-read.table("test.txt", header=TRUE)
p <- ggplot(all_merge, aes(NMDS1, NMDS2, z = shannon))
p + geom_contour()
and my dataset is:
NMDS1 NMDS2 shannon
-0.287555952 -0.129887595 9.516558582
-0.314104852 -0.048655648 8.985087924
-0.214910534 -0.127167065 8.928241917
-0.341295065 -0.296282805 8.315476782
-0.470025718 0.083835083 8.494348157
-0.429386114 0.044064347 8.669813919
-0.427608469 0.124631936 8.15886319
-0.584412991 0.257278736 8.469688185
-0.436526047 -0.070633108 8.496878956
-0.584707076 0.120411579 8.319057817
0.183493022 0.445239412 5.611249955
0.172968855 0.583787121 5.728358304
-0.404838098 -0.0271276 8.679667562
-0.458718755 -0.05638174 8.714026645
0.458621093 -0.186746574 8.094002558
1.148457698 0.044192391 6.058046032
0.346825668 0.258443444 6.682765975
0.753149083 -0.393018506 7.622032803
1.331546069 -0.515095457 5.784195943
0.236285309 0.2553056 7.210095451
0.346995457 -0.816928807 7.198583726
0.137626646 0.129803823 7.663931393
0.340733689 -0.461201268 5.845269914
-0.675116235 -0.037255181 8.371975231
-0.656523041 -0.025798291 8.438133054
-0.578757804 -0.073169316 8.411583639
-0.602672875 0.015207904 8.137468395
0.413598703 0.320133927 5.91489704
0.891714173 1.032329752 3.612230592
0.378252162 0.054121091 7.903450498
0.401158365 0.009307957 8.164654685
-0.074266368 -0.512745143 8.956733268
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…