Re: [R] list output

2015-03-26 Thread Erin Hodgess
It's the double bracket issue. I replaced that, and all is well. Thanks to Peter and Don. Sincerely, Erin On Thu, Mar 26, 2015 at 3:21 PM, MacQueen, Don wrote: > I don't think you are correctly keeping track of the structure of your > objects. > (and my email software may mess up the indenta

Re: [R] list output

2015-03-26 Thread MacQueen, Don
I don't think you are correctly keeping track of the structure of your objects. (and my email software may mess up the indentation, but I can't prevent it) I have not tested, but try replacing out[i]$phi_0 <- x$phi_0 out[i]$maxlike <- x$maxlike out[i]$bigp <- x$bigp with out[[i]] <

Re: [R] list output

2015-03-26 Thread peter dalgaard
Erin, I think you'll have heard people requesting _reproducible_ examples several times by now... This one isn't. Offhand, I'd suspect that the issue has to do with your single-bracket indexing of the list "out". Try out[[i]]. -Peter > On 26 Mar 2015, at 19:22 , Erin Hodgess wrote: > > Hell

[R] list output

2015-03-26 Thread Erin Hodgess
Hello! I am having some trouble with some list output. Here is my code: geobunch <- function(y) { out <- vector("list",3) aic <- numeric(length=3) print(str(out)) for(i in 1:3) { x <- geomin(y,i) print(i) print(x) p