Skip to content
Prev 42278 / 63424 Next

How to modify the start-up message

Hi Ron,

If all you want changed is the message, this seems like a cosmetic
issue.  If that is true, something like this may work where you just
send the unwanted messages to a temporary file and print your own:

require2 <- function(x) {
  junk <- file(file.path(tempdir(), "junk.txt"), open = "wt")
  sink(junk, type="message")
  eval(substitute(require(pkg), list(pkg = x)))
  sink(type="message")
  if (x == "vegan") {
    cat("The message I really want showing", fill = TRUE)
  }
}

require2("vegan")

You could rearrange so that it calls require() for most packages and
only does something special for the one package you want changed.

Cheers,

Josh
On Mon, Jan 16, 2012 at 11:30 AM, Ron Michael <ron_michael70 at yahoo.com> wrote: