[R] A matrix automation problem
megh700004 at yahoo.com
Thu Oct 23 05:57:40 CEST 2008
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?
>> a <- matrix(1:9, 3) * 10
>> b <- matrix(1:9, 3)
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow at imail.org
>> -----Original Message-----
>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> project.org] On Behalf Of megh
>> Sent: Wednesday, October 22, 2008 3:22 AM
>> To: r-help at r-project.org
>> Subject: [R] A matrix automation problem
>> [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
>> Now combining all those 9 new matrices, I construct a final metrix as :
>> c =
>> b1 b4 b7
>> b2 b5 b8
>> b3 b6 b8
>> I want to automate this procedure for any arbitrary number "i"
>> Can anyone please help me how to do that?
>> View this message in context: http://www.nabble.com/A-matrix-
>> Sent from the R help mailing list archive at Nabble.com.
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> and provide commented, minimal, self-contained, reproducible code.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/A-matrix-automation-problem-tp20106932p20123993.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help