[R] Array Help

From: Usman Munir <usman.munir06_at_googlemail.com>
Date: Mon, 07 Mar 2011 11:54:24 +0000


Hi,

I have two 3 D arrays. Both are of this form

array_1<- array[n,n,k]
array_2<-array[m,m,k]

Lets say n=83 and m=80
Since n>m. I would like to add rows and columns to array_2 to make them equal. I want to keep the size of the third dimension fixed i.e.. k.

i.e.
if (nrow(array_1)>nrow(array_2))
{
array_2[m:n,m:n,]<- 10^6

}

But this doesn't work. I tried abind and rbind but it didn't work either. Any help/tips will be appreciated!

Thanks,
Usman

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 07 Mar 2011 - 13:13:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Mar 2011 - 15:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive