How do I write all the printed items in .txt file as an output in R -
suppose have hundreds of print statements , inside loop. although these print statements displayed while running code, want summarized output file written in realtime or @ completion of job.
for example
print("first print , write.txt") check<-1:50 for(i in 1:length(check)){ print(paste0("this want print , write output",i)) print(paste0("this want print , write output.txt",i)) }
i check sink()
function. can find information here
http://www.statmethods.net/interface/io.html
you can setup file want write, , can use cat()
output information. can have output sent file , console.
Comments
Post a Comment