我使用vegan
包对一些植被数据的时间序列进行了排序。由于排序图通常包含许多数据点,因此我提取了前两个排序轴的特征值并取每组的平均值。现在我每个站点只有一个点(总共 11 个站点)为了仍然显示一些变化,我添加了具有标准偏差和 95% 置信区间的椭圆:
我要做的最后一件事是用箭头连接同一组(A、B 或 C)的点,指示随时间变化的方向。所有的运动都是从右到左。
我最初想在 中使用该ordiarrow
函数vegan
,但这仅在 class 为decorana
. 我的班级是factor
.
使用ggplot2
似乎不是一个有效的选项,因为ordiellipse
函数(创建省略号)在那里不起作用。
绘制数据的代码:
install.packages("vegan")
library(vegan)
plot(Ord_KIKKER, type = "n", main = "Kikkervalleien",
xlab = "DCA1 Eigenvalue = 0.62", ylab = "DCA2 Eigenvalue = 0.39")
points(ORD_KIKKER, cex = 2, pch = 19,
col = c("black", "black", "black", "red","red", "green", "green", "green", "blue", "blue", "blue"))
生成的图看起来有点不同,因为我在这里发布了一个简化的数据集。
我的数据(Ord_KIKKER):
structure(list(DCA1 = c(2.676616032, 0.361181861, -1.363464067,
3.176862449, -0.087190269, 2.059548542, 0.167440366, -0.459090096,
1.571536367, 0.309623788, -0.25787459), DCA2 = c(0.276788721,
0.422077659, 0.181723453, 0.221610649, 0.940063655, -0.116083905,
-0.539375059, -0.545053063, -0.06120542, -0.367148924, -1.679257818
), Unique = structure(c(1L, 5L, 8L, 2L, 9L, 3L, 6L, 10L, 4L,
7L, 11L), .Label = c("2001A", "2001B", "2001C", "2001D", "2008A",
"2008C", "2008D", "2018A", "2018B", "2018C", "2018D"), class = "factor"),
BLOCK = structure(c(1L, 1L, 1L, 2L, 2L, 3L, 3L, 3L, 4L, 4L,
4L), .Label = c("A", "B", "C", "D"), class = "factor")), .Names = c("DCA1",
"DCA2", "Unique", "BLOCK"), class = "data.frame", row.names = c("2001A",
"2008A", "2018A", "2001B", "2018B", "2001C", "2008C", "2018C",
"2001D", "2008D", "2018D"))