1

给定以下 R 代码:

require(lattice)
x <- c(1:10)
y <- c(1:10)
g <- expand.grid(x = 1:10, y = 1:10, gr = 1:2)
g$z <- c(as.vector(outer(x,y,"*")), rep(50,100))
wireframe(z ~ x * y, data = g, groups = gr)

生成的曲面的交点很难看,因为它遵循网格线。

有没有办法让表面之间的交点看起来更好(除了增加网格的分辨率)?也许通过传递一些参数或使用另一个包进行可视化?

4

1 回答 1

0

Well, since I couldn't resist goofing off, here are a few possiblities for ways to smooth your data.

The package scvm appears to have some 2D model-fitting tools.

The fields package is recommended here: How can I smooth an array in R?

The DiceKriging package is reviewed here: https://stats.stackexchange.com/questions/13510/fitting-multivariate-natural-cubic-spline

于 2013-12-13T12:45:54.457 回答