Re: [R] counting row repetitions without loop

2008-02-07 Thread Waterman, DG (David)
115 81 7 103 125 8 76 54 9 114 117 10 96 18 ...and so on for many rows. Cheers David. -Original Message- From: Doran, Harold [mailto:[EMAIL PROTECTED] Sent: 06 February 2008 15:03 To: Doran, Harold; Waterman, DG (David); r-help@r-project.org Subject: RE: [R] counting row repetit

Re: [R] counting row repetitions without loop

2008-02-06 Thread Douglas Bates
On Feb 6, 2008 8:08 AM, Waterman, DG (David) <[EMAIL PROTECTED]> wrote: > Hi, > I have a data frame consisting of coordinates on a 10*10 grid, i.e. > > example > x y > 1 4 5 > 2 6 7 > 3 6 6 > 4 7 5 > 5 5 7 > 6 6 7 > 7 4 5 > 8 6 7 > 9 7 6 > 10 5 6 > What I would

Re: [R] counting row repetitions without loop

2008-02-06 Thread Doran, Harold
gt; matrix(c(dat$x, dat$y), ncol=2) mat[gg] <- dat$Freq > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Waterman, DG > > (David) > > Sent: Wednesday, February 06, 2008 9:08 AM > > To: r-help@r-projec

Re: [R] counting row repetitions without loop

2008-02-06 Thread Doran, Harold
id) > Sent: Wednesday, February 06, 2008 9:08 AM > To: r-help@r-project.org > Subject: [R] counting row repetitions without loop > > Hi, > > I have a data frame consisting of coordinates on a 10*10 grid, i.e. > > > example > x y > 1 4 5 > 2 6 7 > 3 6

Re: [R] counting row repetitions without loop

2008-02-06 Thread James Foadi
On Wednesday 06 February 2008 14:08, Waterman, DG (David) wrote: > Hi, > > I have a data frame consisting of coordinates on a 10*10 grid, i.e. > > > example > > x y > 1 4 5 > 2 6 7 > 3 6 6 > 4 7 5 > 5 5 7 > 6 6 7 > 7 4 5 > 8 6 7 > 9 7 6 > 10 5 6 > > What I would li

[R] counting row repetitions without loop

2008-02-06 Thread Waterman, DG (David)
Hi, I have a data frame consisting of coordinates on a 10*10 grid, i.e. > example x y 1 4 5 2 6 7 3 6 6 4 7 5 5 5 7 6 6 7 7 4 5 8 6 7 9 7 6 10 5 6 What I would like to do is return an 10*10 matrix consisting of counts at each position, so in the above example