how to load RData in a loop with different file name?
3
0
Entering edit mode
@james-anderson-1641
Last seen 10.2 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20070625/ b5639236/attachment.pl
• 1.7k views
ADD COMMENT
0
Entering edit mode
Byron Ellis ▴ 100
@byron-ellis-2138
Last seen 10.2 years ago
for(i in 1:N) { load(paste("A",i,".RData",sep="")) } On 6/25/07, James Anderson <janderson_net at="" yahoo.com=""> wrote: > Hi, > > I have 10 .RData files with names A1.RData, A2.RData, ...,A10.RData. Is there an automatic way to load those data in a loop so that for each iteration k, it reads in Ak.RData? I know how to do this for "save" command so that each iteration, but don't know how to do it using "load" command. > > Thanks a lot! > > James > > > --------------------------------- > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Byron Ellis (byron.ellis at gmail.com) "Oook" -- The Librarian
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 13 hours ago
Seattle, WA, United States
Hi James, James Anderson wrote: > Hi, > > I have 10 .RData files with names A1.RData, A2.RData, ...,A10.RData. Is there an automatic way to load those data in a loop so that for each iteration k, it reads in Ak.RData? I know how to do this for "save" command so that each iteration, but don't know how to do it using "load" command. > This should not be fundamentally different from what you did with "save": load(paste("A", k, ".RData", sep="")) Cheers, H. > Thanks a lot! > > James > > > --------------------------------- > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
@joern-toedling-1244
Last seen 10.2 years ago
Hello, the argument "file" to the function load can be a usual character string in R, so you could construct it using "paste", for example: for (i in 1:10){ load(paste("A",i,".RData",sep=""))} Regards, Joern James Anderson wrote: > Hi, > > I have 10 .RData files with names A1.RData, A2.RData, ...,A10.RData. Is there an automatic way to load those data in a loop so that for each iteration k, it reads in Ak.RData? I know how to do this for "save" command so that each iteration, but don't know how to do it using "load" command. > > Thanks a lot! > > James > >
ADD COMMENT
0
Entering edit mode
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20070625/ bc8b1f45/attachment.pl
ADD REPLY

Login before adding your answer.

Traffic: 699 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6