Reverse the side-effects of setupProject():

teardownProject(x, origLibPaths)

Arguments

x

Either the list returned by setupProject(), or a character vector of paths to remove (back-compat with the previous .teardownProject(prjPaths, origLibPaths) signature).

origLibPaths

Optional. The .libPaths() to restore. Defaults to x$paths$.previousLibPaths when x is a setupProject() output, so most callers will not need to supply this.

Value

NULL, invisibly. Called for its side effects.

Details

  1. remove the project library directory created by setupProject(),

  2. unlink the project paths returned by setupProject(),

  3. restore the .libPaths() value that was in effect before setupProject() was called.

The previous .libPaths() is stored on the setupProject() output as out$paths$.previousLibPaths (and on attr(out$paths, "extraPaths")), so teardownProject(out) is enough – no need to remember origLibPaths separately.

See also

setupProject() for what is being torn down.