首页 > 解决方案 > 在 R 的 Plantecophys 包中使用 fitacis 绘制多条曲线的问题

问题描述

我正在尝试使用“plantecophys”包在 R 中绘制多条 ACi 曲线。我需要根据植物接受的处理对曲线进行颜色编码。我之前使用不同的数据集完成了此操作,但它不适用于我当前的数据集,我不知道为什么。

我不断收到的错误是: Error: To colour curves by id, fit with id argument (see ?fitacis)

这是由于fitacis()在拟合曲线时未识别 id 的规范。我已将用于 id 的数据更改为调用 id 所需的因子。我尝试了很多解决方法,但都没有奏效,我想要一双额外的眼睛。

代码如下:

#Make Treatment.label a factor
t.datanew$Treatment.label <- as.factor(t.datanew$Treatment.label)
my.fits <- fitacis(t.datanew,group="Curve", method="bilinear",id ="Treatment.label")

#plot all fits on one graph 
palette(rainbow(2))
plot(my.fits,how="oneplot",colour_by_id = TRUE,id_legend = TRUE)

处理水平是“定期浇水”和“过度浇水”。

标签: r

解决方案


推荐阅读