jueves, 31 de enero de 2013

Dibujar una superficie con R:

Este el código que hace esto:

require(grDevices) # for trans3d
## More examples in  demo(persp) !!
##                   -----------

# (1) The Obligatory Mathematical surface.
#     Rotated sinc function.

x <- 5="" length="30)<br" seq="">y <- br="" x="">f <- br="" function="" r="" x="" y="">z <- br="" f="" outer="" x="" y="">z[is.na(z)] <- 1="" br="">op <- bg="white" br="" par="">persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue");