[R-pkg-devel] Change package name

Rolf Turner ro||turner @end|ng |rom po@teo@net
Thu Jun 22 03:33:26 CEST 2023


On Tue, 20 Jun 2023 17:39:48 -0400
<avi.e.gross using gmail.com> wrote:

> If you really need a new package name, is there an accepted way to
> update the old name to at least provide a message for a while as to
> the new name to use and perhaps have the load otherwise fail?

I don't know about "accepted", but the following paradigm seems to me
to be sensible and reasonably efficacious:

* you have a package "foo" the name of which you wish to change to "bar"
* create a new package "bar" which is the same as "foo" except for its
  name
* now replace foo with a skeleton package which has only the file
  First.R in its R directory
* the file First.R should be something like:

> .onAttach <- function(lib, pkg) {
> 	ver <- read.dcf(file.path(lib, pkg, "DESCRIPTION"), "Version")
>         packageStartupMessage(paste(pkg, ver))
>         msg <- paste("\n     This package, \"foo\" is now",
>                      " deprecated.  Users",
>                      "\n     should install and use its",
>                      " successor  \"bar\".\n")
>         packageStartupMessage(msg) }

* submit both "bar" and "foo" to CRAN

cheers,

Rolf Turner

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Stats. Dep't. (secretaries) phone:
         +64-9-373-7599 ext. 89622
Home phone: +64-9-480-4619



More information about the R-package-devel mailing list