the following should work library(lattice) x <- seq(1,100) y <- seq(1,100) gr <- expand.grid(x,y) gr$z <- x + y + rnorm(10000,0,100) cloud(z ~ x + y, data = gr)
also, look for the package rgl which does similar but with more possiblities. On Feb 27, 4:28 pm, Dipankar Basu <basu...@gmail.com> wrote: > Hi R Users, > > I have produced a simulated scatter plot of y versus x tightly clustered > around the 45 degree line through the origin with the following code: > > x <- seq(1,100) > y <- x+rnorm(100,0,10) > plot(x,y,col="blue") > abline(0,1) > > Is there some way to generate a 3-dimensional analogue of this? Can I get a > similar simulated scatter plot of points in 3 dimensions where the points > are clustered around a plane through the origin where the plane in question > is the 3-dimensional analogue of the 45 degree line through the origin? > > Deepankar > > [[alternative HTML version deleted]] > > ______________________________________________ > r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.