Hi,
I would like to create data.frame and increment their name to finally merge
them.
Does anybody has a solution ?
Something like that ?
n<-6
for (i in 1:n) {
m[i]<-data.frame(name,value)
m<-merge(m[i]:m[n])
}
Nolwenn
********************************************
Nolwenn Le Meur
INSERM U533
Facult? de m?decine
1, rue Gaston Veil
44035 Nantes Cedex 1
France
Tel: (+33)-2-40-41-29-86 (office)
(+33)-2-40-41-28-44 (secretary)
Fax: (+33)-2-40-41-29-50
mail: nolwenn.lemeur at nantes.inserm.fr
********************************************
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Iterative data.frame
3 messages · Nolwenn Le Meur, Carlos Ortega, Ott Toomet
Hello,
You can use the following, based on rbind(), as a possible idea.
x.fin<-0
for (i in 1:10) {
x.tmp<-rnorm(10)
x.fin<-rbind(x.fin,x.tmp)
}
Regards,
Carlos.
-----Mensaje original-----
De: owner-r-help at stat.math.ethz.ch
[mailto:owner-r-help at stat.math.ethz.ch]En nombre de Nolwenn Le Meur
Enviado el: martes, 24 de septiembre de 2002 14:28
Para: R-help at stat.math.ethz.ch
Asunto: [R] Iterative data.frame
Hi,
I would like to create data.frame and increment their name to finally merge
them.
Does anybody has a solution ?
Something like that ?
n<-6
for (i in 1:n) {
m[i]<-data.frame(name,value)
m<-merge(m[i]:m[n])
}
Nolwenn
********************************************
Nolwenn Le Meur
INSERM U533
Facult? de m?decine
1, rue Gaston Veil
44035 Nantes Cedex 1
France
Tel: (+33)-2-40-41-29-86 (office)
(+33)-2-40-41-28-44 (secretary)
Fax: (+33)-2-40-41-29-50
mail: nolwenn.lemeur at nantes.inserm.fr
********************************************
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
_____
The information in this email is confidential and it may not be
disclosed or used by anyone other than the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken or
omitted is prohibited and may be unlawful.
Minorplanet cannot accept responsibility for the accuracy or completeness of
this email as it has been transmitted over a public network. If you suspect
that the email may have been amended, please call the sender.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi,
how do you generate your data frames? By reading from file or combining
variables by data.frame()? In the last case you can use args like
tag=value.
I would use a list instead of auto-generating names:
m <- vector("list", 6)
for(i in 1:6)
m[[i]] <- data.frame(...)
If you really have to construct an unique name, use assign().
For merging, I would use either rbind() or cbind(), depending whether you
have the same variables or observations.
Perhaps it helps.
Ott
On Tue, 24 Sep 2002, Nolwenn Le Meur wrote:
|Hi,
|I would like to create data.frame and increment their name to finally merge
|them.
|Does anybody has a solution ?
|
|Something like that ?
|
|n<-6
|for (i in 1:n) {
| m[i]<-data.frame(name,value)
| m<-merge(m[i]:m[n])
|}
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._