[R] any plot ?

kjetil brinchmann halvorsen kjetil at entelnet.bo
Sat Jan 11 14:40:03 CET 2003


On 11 Jan 2003 at 12:22, H. Zmarrou wrote:

Hola!

You need persp, and for the following example, library(mvtnorm) (from 
CRAN)

> x <- seq(-3,3, length=200)
> y <- seq(-3,3,length=200)
> z <- matrix(0, 200, 200)
> for (i in 1:200) for (j in 1:200) {
+    z[i,j] <- dmvnorm(c(x[i],y[j]), c(0,0), 
matrix(c(1,0.5,0.5,1),2,2)) }
> persp(x,y,z)


Kjetil Halvorsen

> 
> Dear R-ers:
> I'm sorry to disturb you, I want just ask if R can plot a given  
> complicated density function. I mean if we have the expression of the 
> density en we want to see how it's look like? and this is a density 
> with two variables thus it's a 3D plot  
> 
> Thank you very much
> Hicham Amsterdam
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list