TeYaP
TeYaP

Reputation: 323

Export text file in a loop to know the progress

I am doing computation with a very big database and when I start a loop in general, it can take few hours. I need to create a text file in the loop, to know at which [i] I am.

The file can be overwritten at evry [i]. It is just to control how it is going without stopping the program.

Any Idea?

Upvotes: 1

Views: 44

Answers (1)

Konrad Rudolph
Konrad Rudolph

Reputation: 545885

Check out the writeLines function. The second argument allows you to specify a file path:

writeLines(as.character(i), 'progress.log')

Upvotes: 1

Related Questions