[R] Random data

2009-11-25 Thread mentor_
Hi, how can I produce random data which lies around a straight line with angle 45 degree. Similar to this image: http://zoonek2.free.fr/UNIX/48_R/g134.png Cheers -- View this message in context: http://old.nabble.com/Random-data-tp26513822p26513822.html Sent from the R help mailing list

Re: [R] Random data

2009-11-25 Thread Dimitris Rizopoulos
one way is: x - sort(rnorm(100)) y - rnorm(100, mean = x, sd = 0.3) plot(x, y) abline(a = 0, b = 1) I hope it helps. Best, Dimitris mentor_ wrote: Hi, how can I produce random data which lies around a straight line with angle 45 degree. Similar to this image:

Re: [R] Random data

2009-11-25 Thread Erik Iverson
-help-boun...@r-project.org] On Behalf Of mentor_ Sent: Wednesday, November 25, 2009 8:43 AM To: r-help@r-project.org Subject: [R] Random data Hi, how can I produce random data which lies around a straight line with angle 45 degree. Similar to this image: http://zoonek2.free.fr/UNIX/48_R

Re: [R] Random data

2009-11-25 Thread Sarah Goslee
That's not a 45-degree angle: the x and y scales are quite different. But you can use corgen from the ecodist package to create correlated x and y variables, and then adjust the scale as needed. Sarah On Wed, Nov 25, 2009 at 9:42 AM, mentor_ ment...@gmx.net wrote: Hi, how can I produce