[R] Frequency

Joe King jp at joepking.com
Mon Nov 2 19:47:18 CET 2009


sorry, I forgot to send my reply to the list, I got to remember to hit reply
all:

So I set up a dummy matrix, v1,v2,v3,v4, an datamatrix

v1 = c(5,3,4)
v2 = c(6,4,6)
v3 = c(9,7,10)
v4 = c(10,10,18)
datamatrix=c(v1,v2,v3,v4)

then do 

sort(table(datamatrix))

Joe King
206-913-2912
jp at joepking.com
"Never throughout history has a man who lived a life of ease left a name
worth remembering." --Theodore Roosevelt


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Val
Sent: Monday, November 02, 2009 10:35 AM
To: r-help at r-project.org
Subject: [R] Frequency

BAYESIAN INFERENCES FOR MILKING TEMPERAMENT IN CANADIAN HOLSTEINS

Hi All,

I have a data  set "x"  with several variables. Sample of the data is shown
below

 V1  v2  v3   v4

   5    6    9   10

 3    4    7   10

 4    6   10   18



I want the frequency  of each  data point sorted by their occurrence.



Below is the output that I want

10    =3

6=2

4=2

9=1

5=1

7=1

3=1

How do I do it in R?



Thanks in advance



Val

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list