Dear Jorge
Thanks a lot.
- Original Message
From: Jorge Ivan Velez <[EMAIL PROTECTED]>
To: Muhammad Azam <[EMAIL PROTECTED]>
Cc: R mailing list
Sent: Tuesday, October 14, 2008 1:52:15 PM
Subject: Re: [R] request: How to ignore columns having zero sums
Dear Muhammad,
Dear Muhammad,
Try also
x <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,0,0,0,0,0,0,0,0);
x1 <- array(x, dim=c(4,6))
x1[,apply(x1,2,function(x) !all(x==0))]
HTH,
Jorge
On Tue, Oct 14, 2008 at 4:02 AM, Muhammad Azam <[EMAIL PROTECTED]> wrote:
> Dear friends
> I have an array consist of r-rows and c-col
try this:
x <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,0,0,0,0,0,0,0,0);
x1 <- array(x, dim=c(4,6))
ind <- colSums(x1) != 0
x1[, ind]
I hope it helps.
Best,
Dimitris
Muhammad Azam wrote:
Dear friends
I have an array consist of r-rows and c-columns e.g.
x=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,0,0,0,0
Dear Dimitris
Thanks a lot.
- Original Message
From: Dimitris Rizopoulos <[EMAIL PROTECTED]>
To: Muhammad Azam <[EMAIL PROTECTED]>
Cc: R Help
Sent: Tuesday, October 14, 2008 10:10:54 AM
Subject: Re: [R] request: How to ignore columns having zero sums
try t
Dear friends
I have an array consist of r-rows and c-columns e.g.
x=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,0,0,0,0,0,0,0,0);
x1=array(x, dim=c(4,6))
output is
> x1
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]123400
[2,]123400
[3,]123400
5 matches
Mail list logo