Re: [R] A matrix automation problem

2008-10-22 Thread markleeds
megh: assuming that i understand what you want, i think below does it but check it carefully because i didn't. i = 1:9 a = matrix(1:9, 3) tempa <- lapply(i,function(.index) { a^.index }) tempb <- lapply(seq(1,dim(a)[1]*dim(a)[2],by=dim(a)[1]),function(.index) { do.call(rbind,tempa[.index

Re: [R] A matrix automation problem

2008-10-22 Thread megh
Thanks for your reply. Your solution is ok for this particular definition of bi = a * i . However I was looking for more general solution, like : bi = a *a*a*(i-times) Is there any better idea? Thanks and regards, Greg Snow-2 wrote: > > Does this help point you in a useful direction? > >>

Re: [R] A matrix automation problem

2008-10-22 Thread Greg Snow
Does this help point you in a useful direction? > a <- matrix(1:9, 3) * 10 > b <- matrix(1:9, 3) > kronecker(b,a) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMA

Re: [R] A matrix automation problem

2008-10-22 Thread Ben Bolker
megh yahoo.com> writes: > > > [I am really sorry if it is double posted, I doubt me previous post could not > reach forum due to some problem with net] > > Suppose I have a matrix : > > a = matrix(1:9, 3) > > >From this matrix, I construct 9 additional matrices : > > i = 1:9 > bi = a * i >