[R] sink() output to another directory

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Fri Sep 14 01:32:04 CEST 2018


On Fri, 14 Sep 2018, Rolf Turner wrote:

> This is simply incorrect; "./" refers to the current directory but "/" refers 
> to the root directory.

Rolf,

   I was not sufficientl clear.

> Note that sink("./mung.txt") gives the same result as sink("mung.txt"). I.e. 
> the "./" is redundant.
>
> If you have a directory "gorp" in your current directory, then
>
>    sink("gorp/mung.txt")
>
> will put the sink() output into the file "mung.txt" in the directory "gorp".

sink('stat-summaries/estacada-wnw-precip.txt')
print(summary(estacada_se_wx))
sink()

results in

24: sink('stat-summaries/estacada-wnw-precip.txt')
25: print(/
           ^
   Does not matter if I use single or double quotes.

Regards,

Rich




More information about the R-help mailing list