[R] accessing info in object slots from listed objects using loops

2010-03-17 Thread torgrims
Hey, I have stacked a couple of garchFit objects in a list with names $fit1, $fit2, ..., $fiti assigning objects names using a loop, i.e. after running the loop modelStack = list($fit1, $fit2,...,$fiti). Thus the following apply; a = modelStack$fit2, then a is the second garchFit object of

Re: [R] accessing info in object slots from listed objects using loops

2010-03-17 Thread Henrique Dallazuanna
Try this: sapply(modelStack, slot, 'fit')['coef',] On Wed, Mar 17, 2010 at 7:11 AM, torgrims torgr...@stud.ntnu.no wrote: Hey, I have stacked a couple of garchFit objects in a list with names $fit1, $fit2, ..., $fiti assigning objects names using a loop, i.e. after running the loop