s-news
[Top] [All Lists]

Re: counting occurrences

To: "Ita.Cirovic-Donev@hypo-alpe-adria.com" <Ita.Cirovic-Donev@hypo-alpe-adria.com>
Subject: Re: counting occurrences
From: "Sarah Goslee" <sarah.goslee@gmail.com>
Date: Mon, 20 Nov 2006 09:08:51 -0500
Cc: s-news@lists.biostat.wustl.edu
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bQqP4cLdlKZTkK5IA6PMasA9G+wgGTKpvmDTf0bx9VFXy42D9ikjx3nwlwiaw63e2JkhUOvlKUpsWLerpHy1fG3IsOYyfUsNgmg55Wb0POul2xX2y6wKc4jmMp082KmelYLhcotw13TNnIJRJXaGSyYeGzW8PFNBHVqDyUNTDGM=
In-reply-to: <OF71C1CDF3.63A8D23D-ONC125722C.004C822A-C125722C.004CECFA@arz.co.at>
References: <OF71C1CDF3.63A8D23D-ONC125722C.004C822A-C125722C.004CECFA@arz.co.at>
Is this what you're looking for?

x <- c("A", "B", "C", "A", "C", "A", "A")
y <- table(x)
y
x
A B C
4 1 2


On 11/20/06, Ita.Cirovic-Donev@hypo-alpe-adria.com
<Ita.Cirovic-Donev@hypo-alpe-adria.com> wrote:




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.


--
Sarah Goslee
http://www.functionaldiversity.org

<Prev in Thread] Current Thread [Next in Thread>