如何从RDA图中排除参数

时间:2016-04-22 15:40:49

标签: r plot rda

我仍然相对缺乏经验来操纵R中的情节,并且需要帮助。我使用rda()函数在R中运行了冗余分析,但现在我需要简化图来排除不必要的信息。我目前使用的代码是:

abio1516<-read.csv("1516 descriptors.csv")
attach(abio1516)
bio1516<-read.csv("1516habund.csv")
attach(bio1516)
rda1516<-rda(bio1516[,2:18],abio1516[,2:6])

anova(rda1516)
RsquareAdj(rda1516)
summary(rda1516)

  varpart(bio1516[,2:18],~Distance_to_source,~Depth, ~Veg._cover, ~Surface_area,data=abio1516)
plot(rda1516,bty="n",xaxt="n",yaxt="n",main="1516; P=, R^2=",
     ylab="Driven by , Var explained=",xlab="Driven by , Var explained=")

制作的情节如下所示: rda plot

请帮我修改我的代码:排除网站(坐#),所有轴和内部虚线。

我也想扩大字段的大小,或者将矢量标签移动到绘图字段中的所有值。

根据回复更新,此点下方的工作代码

plot(rda,bty="n",xaxt="n",yaxt="n",type="n",main="xxx",ylab="xxx",xlab="xxx
Overall best:xxx")

abline(h=0,v=0,col="white",lwd=3)
points(rda,display="species",col="blue")
points(rda,display="cn",col="black")
text(rda,display="cn",col="black")

enter image description here

1 个答案:

答案 0 :(得分:1)

首先使用type = "n"绘制rda,生成一个空图,您可以添加所需的内容。虚线被硬编码到plot.cca函数中,因此您需要创建自己的版本,或使用abline隐藏它们(然后使用box来掩盖轴上的孔)。

require(vegan)
data(dune, dune.env)
rda1516 <- rda(dune~., data = dune.env)

plot(rda1516, type = "n")
abline(h = 0, v = 0, col = "white", lwd = 3)
box()
points(rda1516, display = "species")
points(rda1516, display = "cn", col = "blue")
text(rda1516, display = "cn", col = "blue")

如果text标签位置不正确,您可以使用参数pos来移动它们(只要您使用整数1到4的箭头数量,就可以生成一个向量向下,向左,向上或向右移动标签。(可能有更好的解决方案)