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
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
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
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
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
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
6 matches
Mail list logo