Petr Pikal wrote:
Oops, you wanted to count number of pairs, this modification
should work
int<-interaction(tab[,1],tab[,2])
counts<-table(int)
count.no<-names(counts)
selection<-match(int,count.no)
cbind(tab,no=as.numeric(counts[selection]))
Yes, thank's for all your answers. This is a way to do
> I have a set of data like the following:
[,1] [,2]
[1,] 102 ...
[10,] 195
I'd like to aggregate it in order to obtain the frequency (the number
of occurences) for each couple of values (e.g.: (10,2) appears twice,
(7,0) appears once). Something cool would be to have this value
Oops, you wanted to count number of pairs, this modification
should work
int<-interaction(tab[,1],tab[,2])
counts<-table(int)
count.no<-names(counts)
selection<-match(int,count.no)
cbind(tab,no=as.numeric(counts[selection]))
Cheers
Petr
On 7 Jun 2004 at 13:05, Petr Pikal wrote:
> Hallo
>
Hallo
On 7 Jun 2004 at 12:18, Nicolas STRANSKY wrote:
> Hi,
>
> I have a set of data like the following:
>[,1] [,2]
> [1,] 102
> [2,]70
> [3,]10
> [4,]10
> [5,] 150
> [6,] 174
> [7,]40
> [8,] 198
> [9,] 102
> [10,] 195
Hi,
I have a set of data like the following:
[,1] [,2]
[1,] 102
[2,]70
[3,]10
[4,]10
[5,] 150
[6,] 174
[7,]40
[8,] 198
[9,] 102
[10,] 195
I'd like to aggregate it in order to obtain the frequency (the number of
occurences) f