On Nov 22, 2010, at 12:27 AM, Hana Lee wrote:
Hi!
I have a matrix called M with dimension (586,100,100).
In R you have an array (not a matrix) wehn the number of dimensions is
3.
I would like to split
and save this into 586 matrices with dimension 100 by 100.
I have tried the followi
Sorry, I did a mistake corrected below.
On Sun, Nov 21, 2010 at 9:50 PM, hb wrote:
> Hi,
>
> On Sun, Nov 21, 2010 at 9:27 PM, Hana Lee wrote:
>> Hi!
>>
>> I have a matrix called M with dimension (586,100,100).
>
> First of all, In R it is only an object with *two* dimensions that is called
> "m
Hi Hana,
Use the paste function to create your file names.
for ( i in 1:dim(M)[1] ) save( M[i,,], file=paste("M_", i, ".img", sep="") )
Alternatively, use the sprintf function to get names with leading
zeroes for easier sorting of files:
for (i in 1:dim(M)[1] ) save( M[i,,], file=sprintf("M_%03
Hi,
On Sun, Nov 21, 2010 at 9:27 PM, Hana Lee wrote:
> Hi!
>
> I have a matrix called M with dimension (586,100,100).
First of all, In R it is only an object with *two* dimensions that is
called "matrix". Anything with two or more dimensions is called an
"array". Example:
> x <- 1:(2*3*4)
> y
4 matches
Mail list logo