Skip to content

directing print.packageInfo to a file

3 messages · Gabor Grothendieck, Kurt Hornik, Brian Ripley

#
print.packageInfo does not print to the console, it uses file.show.
For example, on R 1.9.1 patched on Windows XP:
[1] TRUE
NULL
[1] 0


Kurt Hornik <Kurt.Hornik@wu-wien.ac.at> writes:
What is wrong with

     capture.output(print.packageInfo(x, ...), file = NULL)

for what you want?

-k
#
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

Hth
-k

        
#
On Mon, 2 Aug 2004, Kurt Hornik wrote:

            
or even

oop <- options(pager="console")

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