Re: [R] color for points

2005-10-09 Thread Vincent Goulet
Le 8 Octobre 2005 05:35, [EMAIL PROTECTED] a écrit : Sam R. Smith a écrit : Hi, I have the following code to randomly generate the points: csr -function(n=60){ x=runif(n) y=runif(n) f=cbind(x,y) } plot(csr()) I wonder how to code to make the first twenty points to be BLUE;

[R] color for points

2005-10-08 Thread Sam R. Smith
Hi, I have the following code to randomly generate the points: csr -function(n=60){ x=runif(n) y=runif(n) f=cbind(x,y) } plot(csr()) I wonder how to code to make the first twenty points to be BLUE; second twenty points to be RED; the last twenty points to be GREEN? Thanks, Sam

Re: [R] color for points

2005-10-08 Thread vincent
Sam R. Smith a écrit : Hi, I have the following code to randomly generate the points: csr -function(n=60){ x=runif(n) y=runif(n) f=cbind(x,y) } plot(csr()) I wonder how to code to make the first twenty points to be BLUE; second twenty points to be RED; the last twenty points to be

Re: [R] color for points

2005-10-08 Thread jim holtman
If you know explicitly that there are just 60 points, you can use: plot(csr(),col=c(rep('blue',20), rep('red',20), rep('green',20))) On 10/8/05, Sam R. Smith [EMAIL PROTECTED] wrote: Hi, I have the following code to randomly generate the points: csr -function(n=60){ x=runif(n)