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,

Peter

On Thu, Sep 13, 2018 at 4:35 PM Rich Shepard <rshep...@appl-ecosys.com>
wrote:

> On Thu, 13 Sep 2018, Peter Langfelder wrote:
>
> > Remove the / from the print command, it does not belong there.
>
> Peter,
>
>    So the print() function cannot accept a relative path to a different
> directory for its output? This does seem to be the case:
>
> source('rainfall-dubois-crk-all.r')
> 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.
>
> Thanks,
>
> Rich
>
> ______________________________________________
> R-help@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]]

______________________________________________
R-help@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.

Reply via email to