On Mon, 2 Aug 2004, Kurt Hornik wrote:

> >>>>> Gabor Grothendieck writes:
> 
> > 
> > print.packageInfo does not print to the console, it uses file.show.
> > For example, on R 1.9.1 patched on Windows XP:
> > 
> >> require(chron)
> > [1] TRUE
> >> capture.output(print.packageInfo(help(package = chron)), file = "/abc.txt")
> > NULL
> >> length(readLines("/abc.txt"))
> > [1] 0
> 
> But file.show() can be tuned by playing with options(pager).
> 
> In your case, something like
> 
>   oop <- options(pager = function(file, ...) writeLines(readLines(file)))
>   capture.output(print.packageInfo(help(package = "stats")),
>                file = "abc.txt")
>   options(oop)
> 
> gives
> 
> R> length(readLines("abc.txt"))
> [1] 345

or even

oop <- options(pager="console")

an internal version of the same thing under R for Windows.

-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
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

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to