Skip to content
Prev 165408 / 398506 Next

How can I avoid nested 'for' loops or quicken the process?

On Dec 23, 2008, at 10:56 AM, Brigid Mooney wrote:

            
snip
Have you tried as.data.frame() on Results2? Each of its elements  
should have the proper structure.

You no longer have a reproducible example, but see this session clip:
 > lairq <- apply(airquality,1, function(x) x )
 > str(lairq)
  num [1:6, 1:153] 41 190 7.4 67 5 1 36 118 8 72 ...
  - attr(*, "dimnames")=List of 2
   ..$ : chr [1:6] "Ozone" "Solar.R" "Wind" "Temp" ...
   ..$ : NULL
 > is.data.frame(lairq)
[1] FALSE
 > is.data.frame(rbind(lairq))
[1] FALSE
 > is.data.frame( as.data.frame(lairq) )