Can anyone help me on how to format the text file like the format in the image below? I am using R 2.12.2 so the functions of higher version can't be use.
I have tried using writeLine, sprintf and capture.output, but none of it works.. :(
f_output <- file("sample.txt")
writeLines("D8060WK2LA MET1_PAT__ mpy Trend [5300 2450 2050]\n",f_output)
capture.output(summary(lm_out),file="sample.txt",append=T)
capture.output(anova_out,file="sample.txt",append=T)
close(f_output)
