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

John m|@ojpm @end|ng |rom gm@||@com
Mon May 6 04:24:22 CEST 2019


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]]



More information about the R-help mailing list