s-news
[Top] [All Lists]

Re: Sink function

To: asanquer@virbac.fr
Subject: Re: Sink function
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Fri, 20 Jun 2003 16:31:17 +0100 (BST)
Cc: s-news-list <s-news@lists.biostat.wustl.edu>
In-reply-to: <OFC96A0EA7.F5DEB7CE-ONC1256D4B.005184ED-C1256D4B.0051C910@virbac.fr>
On Fri, 20 Jun 2003 asanquer@virbac.fr wrote:

> I have a question on the sink function (I work with S-plus 6.1):
> I use sink to export all the results of a script in a word file.
> Some results are subsets of data frame, and i would like to choose the
> delimiter between columns.
> Now, S+ provides me this type of results:
> 
>    Case       Group Age
> 67 W133 2 mg/kg/day  NA
> 68 W134 2 mg/kg/day  NA
> 
> the delimiters is a variable number of blanks. To use this type of data in
>    word, i would like to replace blanks by a tab.
> Is someone could help me? is there an options to specified?

If you want to export a rectangular object such as a matrix or data frame 
to be used elsewhere, use one of the tools provided (write.table, 
write.matrix(MASS) and exportData spring to mind).  sink() gives you
already formatted results.


-- 
Brian D. Ripley,                  ripley@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


<Prev in Thread] Current Thread [Next in Thread>
  • Sink function, asanquer
    • Re: Sink function, Prof Brian Ripley <=