1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| invisible(sapply(
c("akima", "fields", "lattice"),
function(xxx) {
library(xxx, character.only = TRUE)
}
))
interpolate <- function(component) {
return(seq(
from = min(component),
to = max(component),
length.out = 2 * length(component)
))
}
#smp1 : jeu de données ; liste à 3 composantes (x, y, z)
smp1Smooth <- with(smp1, interp(x = x, y = y, z = z ,
xo = interpolate(x), yo = interpolate(y))
)
image(smp1Smooth) #bibliothèque "base"
image.plot(smp1Smooth) #bibliothèque "fields"
wireframe(z ~ x * y, data = smp1, shade = TRUE, drape = TRUE, colorkey = TRUE,
pretty = TRUE, par.settings = list(
box.3d = list(col=NA),
axis.line = list(col = "transparent")
)
) |
Partager