Skip to content
Back to formatted view

Raw Message

Message-ID: <7191AFC7255B4F49A30707E39BEAD05F688C60@EXCH-RX03.erasmusmc.nl>
Date: 2012-11-12T08:07:17Z
From: Dimitris Rizopoulos
Subject: Selected matrices of an array and put into a list
In-Reply-To: <1352706977.77106.YahooMailNeo@web172005.mail.ir2.yahoo.com>

One approach is:

BB <- rnorm(6*5*27)
dim(BB) <- c(6, 5, 27)

lapply(2:27, function (i) BB[, , i])


I hope it helps.

Best,
Dimitris


On 11/12/2012 8:56 AM, Haris Rhrlp wrote:
> Dear R users,
>
> I have an array that has matrices that i want BB[16,5,2:27]
> i want to put each of the 26 matrices into a List
>
> thanks in advance
> 	[[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.
>

-- 
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/