[R] list of matrices

Sarah Goslee sarah.goslee at gmail.com
Wed Mar 21 17:19:42 CET 2012


Use
mylist[[i]] = function(...)

mylist[i] and mylist[[i]] are two different things.

On Wed, Mar 21, 2012 at 11:08 AM, David Zastrau <davidz at tzi.de> wrote:
> Hello dear R-users,
>
> I am currently trying to fill some datasatructure (array, list, hash...)
> with matrices that are calculated by a function and do vary in size:
>
> mylist = list()
> for(i in 1:n)
>    mylist[i] = function(...) # returns a matrix
>
> print(mylist[1]) # prints only the first element of the matrix
>
>
> How can I store and afterwards access the matrices that are calculated by my
> function?
>
> Any help would be greatly appreciated!
>
> Best Wishes
> David
>

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list