Every time I want to repeat this I have to change the name of *.txt file manually. How can I automate this, so it could be done for all the *.txt files (1000) I have to generate.

Use something like:

for (i in 1:1000){
  name = paste('foo_', i, '.txt', sep='')

You can figure out how to apply that idea.

You can also refer to a variable by its name in string form, like

a = get(paste('varname', i, sep=''))

paste is your friend!

W

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to