[R] Sink for a subdirectory

Duncan Murdoch dmurdoch at pair.com
Thu May 8 00:08:05 CEST 2003


On Wed, 07 May 2003 21:38:14 +0000, you wrote:

>Hi, how do I sink output to a subdirectory under which R is running?
>
>For example, suppose R is running in ~me and I would like to sink output to
>~me/Subdir/filename.
>
>The obvious sink( "Subdir/filename" ) does not seem to work.

It works for me.  It would be helpful if you said what goes wrong, and
what OS you're running in.

I'm guessing that Subdir doesn't exist; R won't create it.  I don't
think there's a mkdir() function in R; you'll need to create the
subdir outside of R, or use system() to do it.  For example, in
Windows,

system('command /c mkdir Subdir')

would do it.

Duncan Murdoch




More information about the R-help mailing list