-- Helios de Rosario Martínez Researcher >>> El día 22/02/2012 a las 11:32, Florian Weiler <fweile...@jhubc.it> escribió: > Dear all, > > I have a (probably very basic) question. I am imputing data with the mice > package, using 10 chains. I can then write out the 10 final values of the > chains simply by > > name1 <- complete(imp, 1) > : > : > name10 <- complete(imp,10) > > Not a big deal, I just wanted to do that in a little loop as follows: > > for (i in 1:10){ > set[i] <- complete(imp,i)} > > Yet that doesn't work, I also tried other things like: > for (i in 1:10){ > set[[i]] <- complete(imp,i)} > > Again, no success. It only saves a couple of lines of code, but there must > be an easy solution, right? > Thanks, > Florian
Hi Florian, Please give more context. There are various reasons why that could fail. Is your list "set" defined before starting to assign values? Try: set <- vector("list",10) before the loop. INSTITUTO DE BIOMECÁNICA DE VALENCIA Universidad Politécnica de Valencia • Edificio 9C Camino de Vera s/n • 46022 VALENCIA (ESPAÑA) Tel. +34 96 387 91 60 • Fax +34 96 387 91 69 www.ibv.org Antes de imprimir este e-mail piense bien si es necesario hacerlo. En cumplimiento de la Ley Orgánica 15/1999 reguladora de la Protección de Datos de Carácter Personal, le informamos de que el presente mensaje contiene información confidencial, siendo para uso exclusivo del destinatario arriba indicado. En caso de no ser usted el destinatario del mismo le informamos que su recepción no le autoriza a su divulgación o reproducción por cualquier medio, debiendo destruirlo de inmediato, rogándole lo notifique al remitente. ______________________________________________ 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.