Skip to content

news file included in source but not binary package

3 messages · Liaw, Andy, Friedrich Leisch, Duncan Murdoch

#
Thanks to Brian, Roger and Dirk for the pointer to inst.  I do remember it,
but R-exts doesn't really suggest what that directory is for, merely what
would happen to files placed there.  For a source package, though, that
seems a rather obscure place to put a `NEWS' file...

On a slightly different topic:  May I suggest inclusion of something like
the following (suitably modified, if need be) in the next version of R (and
perhaps even advertise it in the startup message)?

news <- function(package=NULL, lib.loc=NULL) {
    if (is.null(package)) {
        file.show(file.path(R.home(), "NEWS"),
                  title=paste("NEWS for R-",
                  paste(R.version[c("major", "minor")], collapse=".")))
    } else {
        ## check if package is installed
        pkgs <- installed.packages(lib.loc=lib.loc)
        which <- match(package, pkgs[, "Package"])
        if (is.na(which)) stop(package, "not found")
        newsfile <- file.path(pkgs[which, "LibPath"], "NEWS")
        if (!file.exists(newsfile)) stop("Sorry, no news from Lake
Wobegon...")
        file.show(newsfile, title=paste("NEWS for ",
                            paste(pkgs[which, c("Package", "Version")],
                                  collapse="_")))
    }
}

Best,
Andy
#
> Thanks to Brian, Roger and Dirk for the pointer to inst.  I do remember it,
  > but R-exts doesn't really suggest what that directory is for, merely what
  > would happen to files placed there.  For a source package, though, that
  > seems a rather obscure place to put a `NEWS' file...

I agree ...

  > On a slightly different topic:  May I suggest inclusion of something like
  > the following (suitably modified, if need be) in the next version of R (and
  > perhaps even advertise it in the startup message)?

  > news <- function(package=NULL, lib.loc=NULL) {
  >     if (is.null(package)) {
  >         file.show(file.path(R.home(), "NEWS"),
  >                   title=paste("NEWS for R-",
  >                   paste(R.version[c("major", "minor")], collapse=".")))
  >     } else {
  >         ## check if package is installed
  >         pkgs <- installed.packages(lib.loc=lib.loc)
  >         which <- match(package, pkgs[, "Package"])
  >         if (is.na(which)) stop(package, "not found")
  >         newsfile <- file.path(pkgs[which, "LibPath"], "NEWS")
  >         if (!file.exists(newsfile)) stop("Sorry, no news from Lake
  > Wobegon...")
  >         file.show(newsfile, title=paste("NEWS for ",
  >                             paste(pkgs[which, c("Package", "Version")],
  >                                   collapse="_")))
  >     }
  > }


You might want to take a look at the system.file() function, that
reduces the above quite condiderably :-)

But to get to the heart of the email (something similar was proposed
by Greg Warnes a few weeks ago): We should definetely provide a simple
mechanism to see the latest changes in a package.

Question: I am aware of files calles NEWS and ChangeLog (or CHANGELOG,
etc.) holding the relevant information ... are there any others we
want/need to respect?

best,
fritz
#
On Thu, 24 Jun 2004 22:14:53 +0200, Friedrich.Leisch@ci.tuwien.ac.at
wrote:
R itself also uses CHANGES (in src/gnuwin32).  There was some talk a
while back about changing this to NEWS.win, and having NEWS.mac, etc.

Duncan Murdoch