[R] sink() output to another directory
peter@|@ng|e|der @end|ng |rom gm@||@com
Fri Sep 14 07:00:13 CEST 2018
Apologies if my advice wasn't clear: the file you want to write to goes in
the sink() function/command. You can put the file anywhere on your file
system, no need to write into current directory and then move the file.
The print command is completely unaware of the file you point to in sink().
Technically, print() sends output to a device called "standard output"
which is usually screen, but it can be changed to a file (_any_ writable
file) using the sink() command.
Hope this helps,
On Thu, Sep 13, 2018 at 4:35 PM Rich Shepard <rshepard using appl-ecosys.com>
> On Thu, 13 Sep 2018, Peter Langfelder wrote:
> > Remove the / from the print command, it does not belong there.
> So the print() function cannot accept a relative path to a different
> directory for its output? This does seem to be the case:
> Error in source("rainfall-dubois-crk-all.r") :
> rainfall-dubois-crk-all.r:25:7: unexpected '/'
> 24: sink('stat-summaries/estacada-wnw-precip.txt')
> 25: print(/
> Then I'll print to the cwd and move the files manually afterwards.
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help