我想通过scatterplot3d绘制响应面图,但以下代码会出错。
如何找出问题所在?
编辑
我正在使用rsm库中的swiss数据。
library(rsm)
swiss2.lm <- lm(Fertility ~ poly(Agriculture, Education, degree = 2), data = swiss)
persp(swiss2.lm, Education ~ Agriculture, zlab = "Fertility")
library(scatterplot3d)
s3d <-
scatterplot3d(
swiss
# , type = "h"
, highlight.3d = TRUE
, angle = 55
, scale.y = 0.7
, pch = 16
)
s3d$plane3d(swiss2.lm, lty.box = "solid")
如何找出问题所在?
编辑
Error in segments(x, z1, x + y.max * yx.f, z2 + yz.f * y.max, lty = ltya, :
cannot mix zero-length and non-zero-length coordinates
我正在使用rsm库中的swiss数据。