[R] combining data frames in a list - how do I add breaks?

jim holtman jholtman at gmail.com
Sun Jan 31 21:15:42 CET 2010


How about posting your complete set of code that is manipulating the
list.  Normally when I am using a list, each list element is the
result from a test/iteration and then I can use something like 'rbind'
at the end.  I would not expect the output you are getting with the
results extending to the right, so it must have something to do with
the code that you are using.

On Sun, Jan 31, 2010 at 2:56 PM, Euan Reavie <euan.reavie at gmail.com> wrote:
> I'm a week-old R user, and have become stuck trying to create usable CSV
> outputs for post-processing. I am using the package Rioja, which provides
> small datasets of results. I am running several analyses in a loop and
> iteratively adding the results to a *list* ("combined"). Within each
> iteration I use the following:
>
>> combined[[i]] <- performance(fit)
>
> With two iterations I get the following list, as output to a CSV:
>
>           object.RMSE object.R2   object.RMSE.1object.R2.1
> WA.inv     0.321543059 0.86388897  0.350494954  0.882600618
> WA.cla     0.345947482 0.86388897  0.373078015  0.882600618
> WA.inv.tol 0.308649941 0.874585589 0.336975196  0.89148291
> WA.cla.tol 0.330038831 0.874585589 0.356895789  0.89148291
>
> Obviously if I run thousands of iterations this continues on to the right,
> and the CSV files end up being too big for post-processing in most
> spreadsheet programs. Instead I want it to look like this...
>
> 1
>           object.RMSE object.R2
> WA.inv     0.321543059 0.86388897
> WA.cla     0.345947482 0.86388897
> WA.inv.tol 0.308649941 0.874585589
> WA.cla.tol 0.330038831 0.874585589
> 2
>           object.RMSE.1 object.R2.1
> WA.inv     0.350494954   0.882600618
> WA.cla     0.373078015   0.882600618
> WA.inv.tol 0.336975196   0.89148291
> WA.cla.tol 0.356895789   0.89148291
>
> ...but I have had no luck getting the list to respond to a break in the
> data. I have tried inserting the iteration number between results using
> "combined[[i]]<-i" and even trying to insert an arbitrary text string
> between results. It seems to ignore any such insertions, and yet gives no
> errors.
>
> I'd appreciate any thoughts on ways to create a more usable output.
> Best - Euan.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list