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. Thanks very much.
On Wed, 7 May 2003, R A F 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, provided Subdir exists. What does `does not seem to work' mean, precisely? There's nothing special about sink(): it can take any valid filename or any writeable connection. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
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
Sorry, my fault. I was actually in Subdir while attempting this. Thanks very much.>From: Prof Brian Ripley <ripley at stats.ox.ac.uk> >To: R A F <raf1729 at hotmail.com> >CC: r-help at r-project.org >Subject: Re: [R] Sink for a subdirectory >Date: Wed, 7 May 2003 22:47:26 +0100 (BST) > >On Wed, 7 May 2003, R A F 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, provided Subdir exists. What does `does not seem to work' >mean, precisely? > >There's nothing special about sink(): it can take any valid filename or >any writeable connection.