Imagine you have a file
sink(\"example.txt\") data.frame(a = runif(10), b = runif(10), c = runif(10)) sink()
and would want to add some hea
Either (A) Read the file in, add your header before and write back out (as Gareth suggested) ..or (B) Cache what you want write to the file somewhere and only write it all out when you've generated your header.