Thanks!
It worked! There is another problem I want to subset the matrix 'red'
in following manner:
dim(red)
23688 164
a=red[1:23688,1:4]
b=red[1:23688,5:8]
c=red[1:23688,9:12]
..
..
z=red[1:23688,161:164]
If there any efficient way to do
Here is one way to do it. BTW 'a'-'z' won't work because there are 41
splits. Use a list instead:
red - matrix(seq(23688 * 164), nrow=23688, ncol=164)
# create indices
indx - split(1:164, cut(1:164, 41))
# now split matrix
newMatrix - lapply(indx, function(x) red[, x])
str(newMatrix)
Thanks! Jim
It solved my problem.
Best
Amit
On Fri, Oct 2, 2009 at 11:19 AM, jim holtman jholt...@gmail.com wrote:
Here is one way to do it. BTW 'a'-'z' won't work because there are 41
splits. Use a list instead:
red - matrix(seq(23688 * 164), nrow=23688, ncol=164)
# create indices
indx
Hi! All,
I am working with a large matrix of dimension 23689 x 162. Some of the
values of this matrix is missing (NA). And it looks something like
that:
dim(red)
23689 162
red
[,1] [,2] [,3] [,4] [,5]
[1,]2 NA4 9 6
[2,]5 NA6 NA 1
[3,] NA
red[is.na(red)] - 0
Sent from my iPhone
On Oct 1, 2009, at 7:22 PM, Amit Kumar amitkumartiw...@gmail.com
wrote:
Hi! All,
I am working with a large matrix of dimension 23689 x 162. Some of the
values of this matrix is missing (NA). And it looks something like
that:
dim(red)
23689 162
01, 2009 3:34 PM
To: Amit Kumar
Cc: r-help@r-project.org
Subject: Re: [R] removing missing values from a matrix
red[is.na(red)] - 0
Sent from my iPhone
On Oct 1, 2009, at 7:22 PM, Amit Kumar amitkumartiw...@gmail.com
wrote:
Hi! All,
I am working with a large matrix of dimension 23689 x 162
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On
Behalf Of Carvalho, Benilton
Sent: Thursday, October 01, 2009 3:34 PM
To: Amit Kumar
Cc: r-help@r-project.org
Subject: Re: [R] removing missing values from a matrix
red[is.na(red)] - 0
Sent from
, Benilton
Sent: Thursday, October 01, 2009 3:34 PM
To: Amit Kumar
Cc: r-help@r-project.org
Subject: Re: [R] removing missing values from a matrix
red[is.na(red)] - 0
Sent from my iPhone
On Oct 1, 2009, at 7:22 PM, Amit Kumar amitkumartiw...@gmail.com
wrote:
Hi! All,
I am working
On 2/10/2009, at 1:03 PM, Carvalho, Benilton wrote:
I agree with you folks, my assumption is that the user knows what he's
doing.
Almost surely a rash assumption! (I.e. except for a set of
users of probability zero.) :-)
cheers,
Rolf
9 matches
Mail list logo