J'ai fait tracé 3D dans rgl.persp3d mais je ne sais pas comment lisse pour voir la tendance. Ou peut-être que la prochaine solution consiste à implémenter wireframe dans rgl.persp3d (parce que j'ai besoin que ce tracé soit interactif). S'il vous plaît, aidez.Lissage terrain 3d dans R
library(mgcv)
x<- rnorm(200)
y<- rnorm(200)
z<-rnorm(200)
tab<-data.frame(x,y,z)
tab
#surface wireframe:
mod <- gam(z ~ te(x, y), data = tab)
wyk <- matrix(fitted(mod), ncol = 20) #8 i 10 też ok
wireframe(wyk, drape=TRUE, colorkey=TRUE)
#surface persp3d
library(rgl)
library(akima)
z_interpolation <- 200
tabint <- interp(x, y, z)
x.si <- tabint$x
y.si <- tabint$y
z.si <- tabint$z
nbcol <- 200
vertcol <- cut(t, nbcol)
color = rev(rainbow(nbcol, start = 0/6, end = 4/6))
persp3d(x.si, y.si, z.si, col = color[vertcol], smooth=T)
Alors wireframe est ni lissées, ni interactive ... et rgl.persp3d est interactif mais pas lissées. Et je ne peux pas avoir à la fois lissé et interactif. juste