export output into text file and open in automatically in r