Good names for R packages are important but difficult to come up with. I rarely choose a good name on my first try, so I rename my packages often. This time I wrote a check list which (despite its imperfections) I hope will help me or someone else rename packages more efficiently next time.

  • Check if the NEWNAME is available with available::available("NEWNAME")
ON GITHUB
  • Change name at: Settings > Repository name.

  • Change link to package-website.

  • Copy remote URL from “Clone or download”.

LOCALLY
  • (For safety leave the old package intact) Clone the repo with New Project > Version Control

  • test() and check().

  • Create branch NEWNAME.

  • Remove OLDNAME.Rproj

  • .Rbiuildignore: Update to NEWNAME

  • Remove man/ and docs/ to simplify search.

  • DESCRIPTION: Search OLDNAME and update to NEWNAME; upgrade version.

  • doucment() and build().

  • README:

    • Search OLDNAME and update to NEWNAME.
    • Clear cache.
    • Knit.
  • NEWs: under new version add “* Rename to NEWNAME”.

  • _pkgdown.yml: Search OLDNAME and update to NEWNAME.

  • LICENSE: Update (easiest to re-run, say, use_gpl3_license())

  • Rename the file containing package documentation (R/NEWNAME-package.R).

  • vignettes/: Search old name and rename.

  • In .github/: Search OLDNAME and update to NEWNAME.

  • In data-raw/: Search OLDNAME and update to NEWNAME.

  • tests/: Search OLDNAME and update to NEWNAME (e.g. tests/testthat.R).

  • Search OLDNAME::, __OLDNAME__, “OLDNAME”, library(OLDNAME)

  • Confirm from the terminal. Search OLDNAME and update to NEWNAME if necessary.

git grep "OLDNAME"
  • Document, build, reload, test.

  • build_site()

  • check().

  • Clean commit.

  • Push branch NEWNAME.

ON TRAVIS
  • profile > accounts: Synchronize user or organization’s account.

  • Filter repositories to find USER/NEWNAME or ORG/NEWNAME.

  • Rebuild if necessary, and check status.

LOCALLY
  • If necessary, fix until passing Travis.

  • Merge branch NEWNAME with master, commit and push.

  • Tag version and push tag to create a new Git Hub release.

git tag -a NEWVERSION -m "Rename from OLDNAME to NEWNAME"
git checkout NEWVERSION
git push origin NEWVERSION
  • Delete branch NEWNAME
ON GITHUB
LOCALLY
  • Prune remote branches locally
git pull
git remote prune origin
SUPPLENT: META PACKAGE

If a meta-package imports the renamed package – like tidiverse imports dplyr –, then also consider this check list.

  • Create branch NEWNAME.

  • check()

  • Remove man/ and docs/

  • DESCRIPTION: Search OLDNAME and update to NEWNAME.

  • README: Search OLDNAME and update to NEWNAME; clear cache; knit.

  • _pkgdown: Search OLDNAME and update to NEWNAME.

  • In R/: Search OLDNAME and update to NEWNAME.

  • Redocument.

  • Commit.

  • Confirm with terminal: Search OLDNAME and update to NEWNAME

git grep "OLDNAME"
  • build_site().

  • check().

  • Push and check status on Travis.

  • Merge master with branch NEWNAME and remove NEWNAME

  • On GitHub, delete useless branches, then prune them locally.