[R] The function sink() --delete everything before printing by "sink()"

Eric Berger er|cjberger @end|ng |rom gm@||@com
Mon May 6 10:02:03 CEST 2019


?sink
 for the HELP page on that sink() function.
Check the description of the (optional) argument append to get an answer to
your question.

On Mon, May 6, 2019 at 5:24 AM John <miaojpm using gmail.com> wrote:

> I use the functions "sink" and "print" to print the results to a txt file.
> May I delete everything in the txt files before it start to print to the
> txt file? Thanks!
> #######
> sink(file_output.txt"))
> for(i in c("a", "b"))
> {
>   for(j in c("c", "d"))
>   {
>     {
>       print(c(i,j))
>       print(xyz1[[i,j]])
>       print("t-stat")
>       print(abc1[[i,j]])
>     }
>   }
> }
> sink()
> #########
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list