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

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

On Wed, Mar 21, 2012 at 11:08 AM, David Zastrau <dav...@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

______________________________________________
R-help@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.

Reply via email to