Message-ID: <CAM_vju=RdJ1706U-XumdPxZhhvTbT0hy0Sux+CtMHGFck_5zLA@mail.gmail.com>
Date: 2012-07-10T14:45:21Z
From: Sarah Goslee
Subject: Count of elements in coulmns of a matrix
In-Reply-To: <1341923464002-4635979.post@n4.nabble.com>
It depends: what's in those "empty" space?
Some combination of apply() and something else, depending on what your
matrix *actually* looks like, and here dput() would be vastly
preferable to copy and paste of something that didn't even come from
an R session.
The something else might involve length() or is.na() or, well, other
possibilities but my telepathy is on the fritz today.
Sarah
On Tue, Jul 10, 2012 at 8:31 AM, Rantony <antony.akkara at ge.com> wrote:
> Could you please tell me what is the function or method to get count of
> elements in all the columns in a matrix ?
>
> for eg :-
>
> ABC XYZ PQR
> ------ ----- ------
> 2 3 4
> 4 5
> 5 4 3
> 2
>
> Result will be like
> ABC XYZ PQR
> ------ ----- ------
> 2 4 3
>
> Could you please help me ?
>
--
Sarah Goslee
http://www.functionaldiversity.org