[R] count frequency

2010-09-17 Thread Alaios
Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,] 59 32 [581,] 60 32 [582,] 60 33 [583,] 60 33 [584,] 60 33 [585,] 60 33 [586,] 60 33 [587,] 60

Re: [R] count frequency

2010-09-17 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/09/10 14:19, Alaios wrote: Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,] 59 32 [581,] 60 32

Re: [R] count frequency

2010-09-17 Thread Henrique Dallazuanna
Try this: aggregate(rep(1, nrow(x)), x, sum) On Fri, Sep 17, 2010 at 9:19 AM, Alaios ala...@yahoo.com wrote: Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,]

Re: [R] count frequency

2010-09-17 Thread Ted Harding
On 17-Sep-10 12:19:10, Alaios wrote: Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,] 59 32 [581,] 60 32 [582,] 60 33 [583,] 60 33 [584,] 60

Re: [R] count frequency

2010-09-17 Thread Jorge Ivan Velez
Alaios, Try as.data.frame(table(x[,1], x[,2)) where x is your matrix. HTH, Jorge On Fri, Sep 17, 2010 at 8:19 AM, Alaios wrote: Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32

Re: [R] count frequency

2010-09-17 Thread Alaios
17 29 18 18 30 19 19 29 20 20 29 Best Regards Alex From: Jorge Ivan Velez jorgeivanve...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Fri, September 17, 2010 4:24:59 PM Subject: Re: [R] count frequency Alaios, Try as.data.frame(table(x[,1

Re: [R] count frequency

2010-09-17 Thread Alaios
: 10 52 28: 5 52 29: 3 So far nothing worked. Best Regards Alex From: Henrique Dallazuanna www...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Fri, September 17, 2010 3:09:36 PM Subject: Re: [R] count frequency Try this: aggregate(rep(1, nrow(x)), x, sum

Re: [R] count frequency

2010-09-17 Thread Henrique Dallazuanna
www...@gmail.com *To:* Alaios ala...@yahoo.com *Cc:* Rhelp r-help@r-project.org *Sent:* Fri, September 17, 2010 3:09:36 PM *Subject:* Re: [R] count frequency Try this: aggregate(rep(1, nrow(x)), x, sum) On Fri, Sep 17, 2010 at 9:19 AM, Alaios ala...@yahoo.com wrote: Hello everyone

Re: [R] count frequency

2010-09-17 Thread Alaios
You are pretty good. Worked nicely :) Thanks! Alex From: Henrique Dallazuanna www...@gmail.com Cc: Rhelp r-help@r-project.org Sent: Fri, September 17, 2010 4:58:50 PM Subject: Re: [R] count frequency So try this : aggregate(rep(1, nrow(x)), as.data.frame(x