[R] save structure to be accesible later

Ivan Calandra ivan.calandra at univ-reims.fr
Thu Feb 5 14:41:11 CET 2015


Hi,

I generally prefer using the functions saveObject() and loadObject() 
from the R.utils package. I like that you load directly to an object in 
the R workspace.

HTH,
Ivan

--
Ivan Calandra, ATER
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calandra at univ-reims.fr
https://www.researchgate.net/profile/Ivan_Calandra

Le 05/02/15 14:07, Olivier Crouzet a écrit :
> Hi, have a look at save() and load().
>
> You can save part of your workspace to a file (save()) and load it from this file (load()). Of course the file format is R specific (but its specifications are free) You may easily share the file with other R users.
>
> Olivier.
>
> --
> Olivier Crouzet
> LLING - Laboratoire de Linguistique de Nantes - EA3827
> Université de Nantes
>
> -----Original Message-----
> From: Alaios via R-help <r-help at r-project.org>
> Sender: "R-help" <r-help-bounces at r-project.org>Date: Thu, 5 Feb 2015 12:57:42
> To: R-help Mailing List<r-help at r-project.org>
> Reply-To: Alaios <alaios at yahoo.com>
> Subject: [R] save structure to be accesible later
>
> Dear all,I have a function that returns the following list. At the end I will call my function 1000 times and I want to keep for each of these 1000 "results" (the structure as given below)in an order to be accessible later (Load the 1000 results and access them within a for loop for example)
> How should I approach the issue?I would like to thank you for your exampleRegardsAlex
> P,S The result of my function
>
>
>
>   str(fitcass1)
> List of 10
>   $ parameters  :'data.frame':   2 obs. of  3 variables:
>    ..$ pi   : num [1:2] 0.833 0.167
>    ..$ mu   : num [1:2] 8828 110000
>    ..$ sigma: num [1:2] 18085 1543
>   $ se          :'data.frame':   2 obs. of  3 variables:
>    ..$ pi.se   : num [1:2] NA NA
>    ..$ mu.se   : num [1:2] NA NA
>    ..$ sigma.se: num [1:2] NA NA
>   $ distribution: chr "gamma"
>   $ constraint  :List of 8
>    ..$ conpi   : chr "NONE"
>    ..$ conmu   : chr "NONE"
>    ..$ consigma: chr "NONE"
>    ..$ fixpi   : NULL
>    ..$ fixmu   : NULL
>    ..$ fixsigma: NULL
>    ..$ cov     : NULL
>    ..$ size    : NULL
>   $ chisq       : num 52.4
>   $ df          : num 5
>   $ P           : num 4.57e-10
>   $ vmat        : num [1:5, 1:5] NA NA NA NA NA NA NA NA NA NA ...
>   $ mixdata     :Classes ‘mixdata’ and 'data.frame':     11 obs. of  2 variables:
>    ..$ X    : num [1:11] 1e+04 2e+04 3e+04 4e+04 5e+04 6e+04 7e+04 8e+04 9e+04 1e+05 ...
>    ..$ count: int [1:11] 993 137 82 30 21 5 7 14 21 2 ...
>   $ usecondit   : logi FALSE
>   - attr(*, "class")= chr "mix"
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list