我的代码是:
pd.lo<-loess(t_INRR_above ~ phylogenetic_distance,data = comp,degree = 1)
predictions1<- predict (pd.lo,comp$phylogenetic_distance)
#plot scatter and line
plot(comp$phylogenetic_distance,t_INRR_above,cex=1,pch=19,xlab="phylogenetic distance",ylab="t_INRR_above")
lines(comp$phylogenetic_distance,predictions1,col = "red")
,
拟合后的图是:
请问为什么拟合出来的曲线有这么多条,我只想要一条曲线。
另外我尝试了loess.control函数,将surface更改为“direct”,但报错:
pd.lo<-loess(t_INRR_above ~ phylogenetic_distance,data = comp,span = 2/3,degree = 1,
+ loess.control(surface = "direct"))
Error in model.frame.default(formula = t_INRR_above ~ phylogenetic_distance, :
参数'(weights)'的种类(list)不对
请各位老师不吝赐教,谢谢。