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 p
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)
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 poi
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