Veg <- read.table(file = "Vegetation2.txt",header = T)
plot(x=Veg$BARESOIL,y=Veg$R,xlim = c(0,45),ylim = c(4,19))
M.Loess <- loess(R~BARESOIL,data = Veg)
#对数据进行计算,Loess平滑
FIT <- fitted(M.Loess)
#拟合
Ord1 <- order(Veg$BARESOIL)
lines(Veg$BARESOIL[Ord1],FIT[Ord1],lwd=3,lty=2,col=14)
#在图上添线