[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:

>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
>in the hidden layer
>but I need to save each time that the model that is build (the end of
>cycle), e.g., when i = 5, I need to save the model with a especific
>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
>name "model_ANN"
>how can I change the name of the model (model_ANN) at each end of cycle
>i values?
>I have already tryied "copy, save, rename,.........." but
>thanks for any answer
>Waldir de Carvalho Junior
>Embrapa Solos/INRA - UMR- LISAH
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list