[R] how to change or copy to another the names of models

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Mar 1 23:17:40 CET 2012


A) you will generally get a better response when your question includes reproducible code/sample data, and a clear identification of the desired final result.

B) in most cases like this, a proliferation of names is not as useful as the OP (you) thinks it is. Much better is to build a list of results that can be indexed by position or by name.

mymodel <- vector( "list", 30 )
for (i in 5:30) {
  mymodel[[i]] <- mlp(X, Y, size=n,....) 
 }
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Waldir de Carvalho Junior <waldircj at gmail.com> wrote:

>Hi
>I would like to know how I can change the name of a model for each
>trainning cycle of a model.
>I work with the RSNNS package and to build a neural network, I used :
>for (i in 5:30) ....
>model_ANN <- mlp(X, Y, size=n,....) # where size is the number of
>neurons
>in the hidden layer
>but I need to save each time that the model that is build (the end of
>each
>cycle), e.g., when i = 5, I need to save the model with a especific
>name,
>when i = 6, also I need to save the model with another name
>How i am doing, i am saving only the last model with n = 30 and with
>the
>name "model_ANN"
>Question
>how can I change the name of the model (model_ANN) at each end of cycle
>of
>i values?
>I have already tryied "copy, save, rename,.........." but
>unsuccessfully
>thanks for any answer
>
>-- 
>________________________
>Waldir de Carvalho Junior
>Pedologia/Pedologue
>Pesquisador/Chercheur
>Embrapa Solos/INRA - UMR- LISAH
>
>	[[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.



More information about the R-help mailing list