table works here as well:
> x<-sample(LETTERS,1100,T)
> y<-sample(c(0,1),1100,T)
> table(x,y)
0 1
A 32 17
B 20 20
C 27 25
D 13 17
E 28 28
F 16 23
G 16 18
H 21 19
I 31 18
J 12 22
K 27 20
L 29 18
M 18 21
N 24 11
O 22 17
P 20 17
Q 24 27
R 22 23
S 17 19
T 30 22
U 24 18
V 22 19
W 18 27
X 20 22
Y 19 23
Z 20 17
JAK
On Mon, 20 Nov 2006 Ita.Cirovic-Donev@hypo-alpe-adria.com wrote:
>
>
>
>
> Sorry, I have an addition to previous email. I also have a vector of zeros
> and ones of equal length as the first vector. The counting should be done
> in the following way:
>
> count each A where it is equal to zero
> count each A where it is equal to one
> and so on for the rest of the qualitative marks.
>
> thanks
>
>
>
> --------
>
> Hi,
>
> I have a vector with qualitative values such as A,B,C,D,E,F,G. The length
> of the column is 1100. I would like to go through the vector an count the
> occurrences of A, B,C and so on and record the values in the new vector. Is
> there a function that does a counting in this way that I can insert into
> the for loop. Thanks.
>
>
>
>
>
> Razmjena informacija s HYPO ALPE-ADRIA-BANK d.d. putem e-maila je bez
> jamstava. Zakljucivanje pravnih poslova putem ovog medija nije dozvoljeno.
> Ovaj e-mail moze sadrzavati povjerljive i/ili povlastene informacije. Ako
> ste ga primili greskom, molimo Vas da nas o tome odmah obavijestite tako
> sto cete na njega odgovoriti, a zatim vas molimo da ga izbrisete iz vaseg
> sustava. Ovime vas obavjestavamo da je svako otkrivanje, kopiranje,
> distribuiranje ili poduzimanje bilo kakvih aktivnosti u vezi s njegovim
> sadrzajem strogo zabranjeno i moze biti nezakonito.
>
>
>
> The exchange of messages with HYPO ALPE-ADRIA-BANK d.d. via e-mail is not
> binding. Declarations regarding legal transactions must not be exchanged
> via this medium. The information contained in this e-mail message is
> confidential and intended exclusively for the addressee. Persons receiving
> this e-mail message who are not the named addressee (or his/her co-workers,
> or persons authorized to take delivery) must not use, forward or reproduce
> its contents. If you have received this e-mail message by mistake, please
> contact us immediately and delete this email message beyond retrieval.
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|